开发者

Get windows XP, windows 7 current login User Name in VC [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

开发者_StackOverflow Improve this question

I want to get current login user name in windows xp, windows 7, in c++. How can I do this? Is there any handy API without authority problem?


Use the Win32 API GetUserName or GetUserNameEx if you want a little more options.


This should work:

char sz[256];
GetEnvironmentVariable ("USERNAME", sz, 256);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜