how can catch hostname and macaddress of pc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • idsanjeev
    New Member
    • Oct 2007
    • 241

    how can catch hostname and macaddress of pc

    hi frainds i try to catch ip_address,mac_ address and hostname of pc that is connected in lan with router or switch. i dont know how to catch hostname of pc and mac_address. i am using code for ip address
    Code:
    Request.ServerVariables("REMOTE_ADDR")
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    I don't believe mac address is returned in the HTTP header, but you can check like this:
    [code=asp]for each x in request.serverV ariables
    response.write x & ": " & request.serverV ariables(x) & "<br>" & vbNewLine
    next[/code]This will list everything that the PC sends to the server.

    I don't think Mac address is included in this list, you might be able to use javascript to pull it client side and send it to the server, like doing a rout-by-res. I'm not sure what you would ask for in javascript.

    Jared

    Comment

    • idsanjeev
      New Member
      • Oct 2007
      • 241

      #3
      my problems in catching ipaddress some time proxy address is catched instead of ip so i want to another identification of that pc.

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        jha,

        There's some links here which have some methods to retrieve the MAC address but they all rely on the machine being on a LAN - I don't think you will be able to do this across the WWW.

        What is it you're trying to do exactly?

        Dr B

        Comment

        • idsanjeev
          New Member
          • Oct 2007
          • 241

          #5
          Originally posted by DrBunchman
          jha,
          What is it you're trying to do exactly?
          Dr B
          I want to catch pc ip attached to proxy not proxy address

          Comment

          • DrBunchman
            Recognized Expert Contributor
            • Jan 2008
            • 979

            #6
            That's difficult, if a machine is behind a proxy it's impossible (as far as i'm aware) to get the IP of the user rather than the proxy. Did you take a look at those possible methods to get the MAC address?

            Without knowing why you want the IP address, would it be possible to use cookies to acheive what you want?

            Dr B

            Comment

            • idsanjeev
              New Member
              • Oct 2007
              • 241

              #7
              I can't getting any perfect solution or may be i don't understand it.
              I am developing on small project that store the computer maintenence detail so my need to know the entered data is entered on that specific pc so my need is catch ip address or any specific identification of that pc.

              Jha

              Comment

              • DrBunchman
                Recognized Expert Contributor
                • Jan 2008
                • 979

                #8
                You could store an ID number as a cookie on a machine when a user first browses your site and use that to identify which machine you are talking to on subsequent visits - do you think that could work?

                Dr B

                Comment

                • idsanjeev
                  New Member
                  • Oct 2007
                  • 241

                  #9
                  Originally posted by DrBunchman
                  You could store an ID number as a cookie on a machine when a user first browses your site and use that to identify which machine you are talking to on subsequent visits - do you think that could work?
                  Dr B
                  how can store an id number as cookies then after how to identify.
                  can you give more detail how can do it
                  jha

                  Comment

                  • DrBunchman
                    Recognized Expert Contributor
                    • Jan 2008
                    • 979

                    #10
                    Use the line:
                    Code:
                    Response.Cookies("UserID") = iUserID
                    To store the ID number as a cookie on their machine. You'll need to generate the ID from somewhere and store it somewhere (a database with an ID column that auto increments would be perfect).

                    Then, on the page you can retrieve the value with:
                    Code:
                    iUserID = Request.Cookies("UserID")
                    If iUserID is not empty then this machine has logged on to your site before and you will now have the ID number to know which machine it was.

                    Does this help?

                    Dr B

                    Comment

                    • idsanjeev
                      New Member
                      • Oct 2007
                      • 241

                      #11
                      this way is helpfull in identification of user not pc so i think this way could not helpful for me becouse only 5 to 10 service engineer have to login privileged and no. of pc is approx thousands so how can it helpfull.
                      JHA

                      Comment

                      • DrBunchman
                        Recognized Expert Contributor
                        • Jan 2008
                        • 979

                        #12
                        Sorry jha, if this won't work for you then I don't have any more suggestions I'm afraid.

                        Hope you find a solution.

                        Dr B

                        Comment

                        • danp129
                          Recognized Expert Contributor
                          • Jul 2006
                          • 323

                          #13
                          You would need to make an activex control or java applet that the client can run, neither of which I've made.

                          Comment

                          Working...