方法一
string username = Environment.UserName;
方法二
WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent();
string username = Path.GetFileName(windowsIdentity.Name);
string username = Environment.UserName;
WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent();
string username = Path.GetFileName(windowsIdentity.Name);
本文标题:获取计算机用户名
本文链接:https://www.haomeiwen.com/subject/wqrzmhtx.html
网友评论