我有一個內部網站,我需要查看誰登錄到Windows PC,以便他們不需要自己鍵入他們的名稱。從asp.net的Windows登錄獲取用戶
我曾嘗試:
System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
和
string strName = HttpContext.Current.User.Identity.Name.ToString();
它工作在我的電腦上,但是當我用它在服務器上沒有。
什麼身份驗證模式是您使用來識別用戶? – SeanCocteau 2012-02-22 12:55:26