当前的WinXP用户名 [英] Current WinXP User name
本文介绍了当前的WinXP用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何通过c#代码获取当前的Windows XP用户名?
How can i get current Windows XP username through c# code?
推荐答案
查看 ^ ].
尝试:
string name = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
这将以字符串形式返回域和用户名.
This will return the domain and user name as a string.
u可以使用
u can use
Environment.UserName
在ur c#代码中获取用户名.
in ur c# code to get username.
这篇关于当前的WinXP用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文