activex 객체를 사용하지 않고 원격 서버에서 호스팅되는 asp.net에서 클라이언트 윈도우 사용자 이름을 얻는 것이 가능합니까?activex 객체를 사용하지 않고 windows 사용자 이름을 얻으십시오
내가 다음 코드를 사용했다
Response.Write("HttpContext.Current.Request.LogonUserIdentity.Name " & HttpContext.Current.Request.LogonUserIdentity.Name)
Response.Write("<br/>")
Response.Write("HttpContext.Current.Request.IsAuthenticated " & HttpContext.Current.Request.IsAuthenticated)
Response.Write("<br/>")
Response.Write("HttpContext.Current.User.Identity.Name " & HttpContext.Current.User.Identity.Name)
Response.Write("<br/>")
Response.Write("System.Environment.UserName " & System.Environment.UserName)
Response.Write("<br/>")
Response.Write("Security.Principal.WindowsIdentity.GetCurrent().Name() " & System.Security.Principal.WindowsIdentity.GetCurrent().Name())
Response.Write("<br/>")
하지만 항상하지 클라이언트 사용자 이름 나에게 서버 사용자 이름을주고있다.
가상 디렉토리/응용 프로그램이 구성되는 방법 ? –
Windows 인증을 사용하는 경우에만 가능합니다. –
이 정보에 액세스하는 방법은 가능하지만 모든 브라우저에서 다릅니다 (존재하는 경우). 예를 들어 Mozilla FireFox는 [nsIEnvironment] (https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEnvironment)를 사용합니다. 따라서 자바 스크립트는 먼저 브라우저를 감지 한 다음 이에 따라 Windows 사용자 이름에 액세스합니다. 또한 C#을 사용하는 경우 [WAFFLE] (http://dblock.github.io/waffle/)을 사용할 수 있습니다. [출처] (https://github.com/dblock/waffle) – Hillboy