GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Feb-2005, 09:35
dexterwolf dexterwolf is offline
New Member
 
Join Date: Jan 2005
Posts: 7
dexterwolf is on a distinguished road

windows user account


Hi,
I need to get the current windows user account.
I've found the class WindowsIdentity and it works, unfortunately I can't use this class couse it's into the .Net framework and I'm writing code to be supported also on machine without that framework.
So i'm searching an alternative way to retrieve the user account.
I've found classes in WMI (win32_Account for exaple), but they all get ALL the users account, i need only the current logged one.

Anyone can help me, perhaps with source code?

Thank all

Damiano
Firenze
  #2  
Old 04-Feb-2005, 11:17
Dr. Evil Dr. Evil is offline
Member
 
Join Date: Oct 2004
Location: Netherlands
Posts: 120
Dr. Evil will become famous soon enough
Looking at the source to Wget, there are several ways to get the user name, if that's what you're asking. The first would be the GetUserName() function, which you can find here. There's also a whole other slew of functions that retrieve/set info like that. If that dosn't work, you could try getting the environmental variable USERNAME via getenv(). Yet another possible way would be to read the value username in the registry key HKEY_LOCAL_MACHINE\Network\Logon, or so it says.
 

Recent GIDBlogPrepping for deployment by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command & Conquer 95 under XP dexter Computer Software Forum - Games 41 29-Jun-2008 12:45
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 13:12
CDialog::Onsize problem in Windows 2000 Professional Environment vikravel MS Visual C++ / MFC Forum 0 31-Jan-2005 06:59
Trouble with Windows XP vsseym Computer Software Forum - Windows 29 12-Aug-2004 03:56

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:22.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.