方法一
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);