Results 1 to 8 of 8

Thread: ip address

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    ip address

    Is there a way to obtain an IP address/MAC Address of the computer currently accessing an ASP.NET website?

  2. #2
    Fanatic Member -TPM-'s Avatar
    Join Date
    Jul 2005
    Posts
    850

    Re: ip address

    Yes like this:
    Request.UserHostAddress()
    TPM

    Add yourself to the VBForums Frappr Map!!

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: ip address

    lol thanks... there are soo many ways ive discovered of getting the IP address

    however the thing is, if the user is behind a router, it will only give back the webserver the local IP address of that computer not the REAL IP... how is it possible to resolve that?

  4. #4
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: ip address

    It will only return the IP address used to connect to the server.

    We have a LAN here which is attached via ADSL to the Internet. If I access a local development server (that is on the LAN) it will report my IP address as 192.168.13.54 (local IP). However if I connect to an external server it will report it as, for example, 61.125.62.134 - this is the IP address of our ADSL router.

    I don't believe there is a way around this. It's a bit of a bugger if you are trying to limit by IP address because everybody on site here will report the same IP - to the server they look like the same computer.

    Let me know if you have any other queries.

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  5. #5
    Fanatic Member -TPM-'s Avatar
    Join Date
    Jul 2005
    Posts
    850

    Re: ip address

    Using the local ip probably wouldn't help much anyway though.
    An unreal ip can easily be changed so it's not much use for security.
    Different networks can have the the same subnet (ip range) so you could still get the duplicate ip's.
    If you do still want it though, you could look at a client script to recover it, Java etc.
    It might be easier to just use a GUID in a cookie perhaps...
    TPM

    Add yourself to the VBForums Frappr Map!!

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: ip address

    yeh i know but at least I have an IP which has the ISP they are using etc...

    ok - what about MAC Addresses? I've been reading its pretty tough to do it, i found a way of getting the local box's mac address but not the client, so I guess some client side scripting has to be done to get the MAC Address and send it back to the server.

    how do I get the client MAC Address?

  7. #7
    Fanatic Member -TPM-'s Avatar
    Join Date
    Jul 2005
    Posts
    850

    Re: ip address

    I did a quick search and didn't come up with a way to retrieve the MAC Address (I'm sure there must be a way, but it might be more hassle than it's worth). Something to point out is dialup users won't have a mac address( I know not many people are on dialup anymore, but still)
    What exactly do you want the IP/MAC for? Perhaps there’s another way…
    TPM

    Add yourself to the VBForums Frappr Map!!

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: ip address

    there wont be another way unfortunatly.

    Want to require it so I can store it in my SQL Database which tracks down users etc...

    Reason being, so I can report them to the ISP/whatever for vandalizing my guestbook/website/whatever

    it's to track down users who enter stuff into the guestbook. I can get the IP address no problem (Request.UserHostName/whatever) but now its getting the MAC address
    as for the dial up issue - thats fine because I can give the ISP the ip address it had as well as date and time. It may be acceptable to them but prefer to have a MAC Address for non dial up users

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width