Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


getting computer name in web application

Posted on 2007-10-10
Medium Priority
Last Modified: 2013-11-26
hello experts,
I created a website form , when users type http://support in IE address bar, that form must be visible for them, I want to get computer name of users when they click submit button.
my os is win xp,
IDE: .net and asp.net and vb.net
Question by:farhadtolooie
LVL 53

Expert Comment

ID: 20048201
Perhaps this article can help you further
How To Obtain The Name Of The Client From The ASP Server
LVL 23

Expert Comment

by:Ashish Patel
ID: 20048212
I use this in ASP, may be it can help you.
      Function MyMachineName()
            on error resume next
            Set WshNetwork = server.CreateObject("WScript.Network")
            Set WshNetwork = Nothing
            MyMachineName = IntMachinName
      End Function

Author Comment

ID: 20054998
hello asvforce
your code return client computer name for me in .net?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 23

Expert Comment

by:Ashish Patel
ID: 20055552
Dim ClientMachineName
ClientMachineName = Request.ServerVariables("REMOTE_HOST")
LVL 23

Accepted Solution

Ashish Patel earned 1000 total points
ID: 20055718
The code above gives you just IP of client's machine. But before you go ahead read the below and check the link given.
Thanks to Dhaest: for the detailing link.

If you want this to actually give you the name of the remote machine then there's some additional work you have to do. Since we have the IP address then we can do a reverse DNS lookup to see if there is a friendly name associated with that address. Now the server is trusting not an arbitrarty client but rather a specific reverse DNS server.

Read this Knowledge Base article on how to configure your server to automatically do Reverse DNS lookups when the code above is called.


Note that this will make your server performance worse, and of course is not guaranteed to work if the client machine is disguising its identity via a firewall, etc.


Expert Comment

ID: 20057352
Try using -

clientMachineName = Request.UserHostName
clientMachineIP = Request.UserHostAddress

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question