Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I read the client's machine/computer name from the browser?

How can I read the client's machine/computer name from the browser?
Is it possible using JavaScript and/or ASP.NET?

like image 618
MetaGuru Avatar asked May 28 '09 18:05

MetaGuru


2 Answers

You can do it with IE 'sometimes' as I have done this for an internal application on an intranet which is IE only. Try the following:

function GetComputerName() {     try {         var network = new ActiveXObject('WScript.Network');         // Show a pop up if it works         alert(network.computerName);     }     catch (e) { } } 

It may or may not require some specific security setting setup in IE as well to allow the browser to access the ActiveX object.

Here is a link to some more info on WScript: More Information

like image 50
Kelsey Avatar answered Sep 28 '22 05:09

Kelsey


Browser, Operating System, Screen Colors, Screen Resolution, Flash version, and Java Support should all be detectable from JavaScript (and maybe a few more). However, computer name is not possible.

EDIT: Not possible across all browser at least.

like image 23
nevets1219 Avatar answered Sep 28 '22 05:09

nevets1219