How to get Client Machine Name in ASP.NET / C#?

后端 未结 4 1493
悲哀的现实
悲哀的现实 2020-12-17 16:00

I have application want to get user machine name, here I can retrieve and it works fine in localhost.

string clientPCName;
string[] computer_name = System.N         


        
4条回答
  •  时光取名叫无心
    2020-12-17 16:53

    Once you enable browser to allow creation of active-x objects, for IE you can write below javascript code to get client computer name as:

    var WinNetwork = new ActiveXObject("WScript.Network");
    var ComputerName = WinNetwork.ComputerName;
    

提交回复
热议问题