C# 獲取系統當前登錄用戶SID
在另外一篇文章中提到過用程序獲取,So
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Principal; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { WindowsIdentity curUser = WindowsIdentity.GetCurrent(); //用户SID SecurityIdentifier sid = curUser.User; //用户全名 NTAccount ntacc = (NTAccount)sid.Translate(typeof(NTAccount)); Console.WriteLine("用戶SID:{0} nr用戶全名:{1}", sid.Value, ntacc.Value); Console.ReadKey(); } } }
你咋这么喜欢用繁体呢。
公司電腦嘛….輸簡體會亂碼的,所以輸入法什麼的全是繁體
很久没写日志了啊。
積累得差不多再寫出來吧……每日一水可不好喔
其实你可以加一个回复评论邮件通知,这样就不用跑这里来看是否有回复了。
評論郵件通知很早就弄了,那我回覆你的時候,你收到郵件嗎?