kiran n

kiran n

  • 1.4k
  • 353
  • 4.9k

Javascript or C# code to get window login username

Feb 17 2015 11:51 PM

I created an asp.net application to get window login user name.
I have a code this to return window login user name. But it works in IE only.
var WinNetwork = new ActiveXObject("WScript.Network");
alert(WinNetwork.UserName)

I tried in C# :
Request.ServerVariables("LOGON_USER")
When i hosted my application on server above code returning my server login user name.
Now what i want Javascript  (all browser support) or C# to get window login user name. 
Any one idea please share this.

Answers (1)