How to get hold of the client computername with Javascript and how to integrate this into ASP.NET

Hi I am looking for some javascript code that will pick up the clients computer name? is this possible as I need to find the computername of the person logging a call with our e-form. I not a javascript whizz so would really appreciate some completed code snippets and advise on intergrating this into asp.net. Many thanks Adypips.
adypipsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

raterusCommented:
Unless you are on an intranet, where you have DNS control of the computers of your clients, you are out of luck.  Javascript security prevents you from obtaining this name.
0
adypipsAuthor Commented:
This is all for internal use so, on intranet. Is there away around the security if for internal use? I can get the IP Address. Would I have to pass the IP address to look up the name using DNS?
0
raterusCommented:
Yes, you just need to run a reverse DNS lookup using the IP Address.  This of course is dependent on your local DNS server being properly maintained with reverse entries.

You should find plenty of examples if you search for "Reverse DNS .net", but let me know if you can't figure it out.
0
adypipsAuthor Commented:
Thanks raterus your help is appriecated. Thanks again Adrian
0
adypipsAuthor Commented:
I have found a way of achieving this this works really well.

script type="text/javascript">
    
    var WshNetwork = new ActiveXObject("WScript.Network");
    var strComputer = WshNetwork.ComputerName;
   
    
//  document.getElementById("Text1").value = strComputer // This allow you to store in textbox for example
    document.write(strComputer);  // Or you can just write out to webform/webpage.
</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.