Archived

This topic is now archived and is closed to further replies.

doctorsixstring

Getting a User Name

Recommended Posts

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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites