Link to home
Start Free TrialLog in
Avatar of Stefan Motz
Stefan MotzFlag for United States of America

asked on

Capture the web page visitor's computer name

Hi Experts,
I would like to display content on a web page based by the logged in user's computer name.
i.e.
If computer name is 'ABC123' then the web page displays 'XXX Content'
If computer name is 'XYZ123' then the web page displays 'WWW Content'
If computer name is not in the database then the web page displays 'You are not registered'

The computer names are retrieved from a SQL Server database.
Is there any script that can capture the visitor's computer name and display the content accordingly?
I am using classic ASP.

Thank you for your help.
Avatar of Dr. Klahn
Dr. Klahn

Is there any script that can capture the visitor's computer name?

Not all computers have names, and many (I dare say most) systems do not respond on the identd port.

But even If there is such a script, it will not work reliably.  The recent versions of Firefox, and the Brave browser, do their utmost to avoid revealing any information about the host computer to the web site.
Avatar of Stefan Motz

ASKER

All users accessing the web page have computer names as this is an internal web site. This wouldn't be an issue in my case.
The problem is that users are accessing the web page from different browsers, like IE, Firefox, Chrome.
I found a JavaScript that works only in IE. I'm looking for one that works in all browsers. This is the one that works only in IE:

<script type="text/javascript">
    var network = new ActiveXObject('WScript.Network');
    document.write(network.computerName);
</script>

Dr. Klahn, thank you for your response.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much Scott, HOST_NAME() did it!