开发者

Get Username of the Computer to know who uses the application on a local network in .NET

How to get username of the computer (user account) for a .NET application to use it for log table of the application. So if the application has multiple users on the LAN, I ca开发者_如何转开发n understand who did what by looking at the log table. I can get machine name but I need user name of the computer because multiple users can use one computer with their own user accounts.

Thanks in advance,


string user = System.Windows.Forms.SystemInformation.UserName;


I think there is Environment class you can use, it has the Username property which shows the windows user account name

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜