Getting a User Name

Started by
1 comment, last by doctorsixstring 21 years, 9 months ago
How can I get the name of the currently logged in user? I have tried GetUserName(), but it returns this error: "The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist." I am using VC++ 6.0 with Win32. I am working in Win98, but I need to be able to get the user''s log-in name from both Win9x and WinNT based systems. Thanks in advance, Mike
Advertisement
If the user doesn''t log in then there is no username to get. Reread the error message.
Probably just what the error message says, no one is logged
in when you run the program. This is possible on Win9X
systems, but not so in WinNT systems.

NetUserGetInfo() probably better to use, but it''s only
available on NT systems.


~~~~
Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!

This topic is closed to new replies.

Advertisement