1
Answer

Javascript or C# code to get window login username

kiran n

kiran n

9y
2.1k
1

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)
Next Recommended Forum