![]() |
|
#1
|
|||
|
|||
windows user accountHi,
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
|
|||
|
|||
|
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 GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command & Conquer 95 under XP | dexter | Computer Software Forum - Games | 42 | 20-Sep-2008 13:30 |
| [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