Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have an ASP.NET application that is located on the server but is accessed from client machines. I need the application to retrieve computer name of the client computer that accesses the application. How can I do that using javascript?

What I have tried:

Tried using ActiveXObject but doesn't work
Posted
Updated 28-Nov-18 19:33pm
Comments
Afzaal Ahmad Zeeshan 29-Nov-18 6:10am    
Simple ask the user for an input, if they are interested in your service, they will more likely provide you with the input.

1 solution

You can't. Details about the actual machine the browser is running on are not available to Javascript code for security reasons, and that includes the machine name.

Your only method is an ActiveX control, and good luck with that - they will only run on less than 1% of modern machines (and then only the very-low-security-settings ones).
 
Share this answer
 
Comments
Member 12648547 29-Nov-18 2:01am    
I tried this using ActiveX.it doesn't for Chrome.
Is any another solution for the same.
OriginalGriff 29-Nov-18 2:13am    
ActiveX only works of IE - and even then, it is disabled by default in nearly all versions of IE because ActiveX was a massive security hole that had to be plugged.

There is no way to do this in a browser by design.
Member 12648547 29-Nov-18 4:30am    
ok... Thanks for your reply
OriginalGriff 29-Nov-18 4:33am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900