开发者

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

开发者 https://www.devze.com 2022-12-21 07:04 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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

精彩评论

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

关注公众号