getting computer name in web application

Posted on 2007-10-10
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 and
Question by:farhadtolooie
    LVL 53

    Expert Comment

    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
    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

    hello asvforce
    your code return client computer name for me in .net?
    LVL 23

    Expert Comment

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

    Accepted Solution

    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.;en-us;Q245574

    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.

    LVL 2

    Expert Comment

    Try using -

    clientMachineName = Request.UserHostName
    clientMachineIP = Request.UserHostAddress

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now