How to find external IP of a machine in ASP.Net 2003?

Last post 08-08-2007 8:45 AM by amit.andharia@etatvasoft.com. 6 replies.

Sort Posts:

  • How to find external IP of a machine in ASP.Net 2003?

    12-13-2006, 1:47 AM
    I want to find external IP(or static IP) of a machine from its internal IP address. How to do this?
    Or Can we find external IP address of the client's machine directly?
    I find internal IP address of client machine using Request.ServerVariables("LOCAL_ADDR")
    Now I want its external IP Address?
  • Re: How to find external IP of a machine in ASP.Net 2003?

    12-14-2006, 11:05 PM
    • Star
      12,930 point Star
    • Iori_Jay
    • Member since 04-04-2006, 10:21 AM
    • Posts 2,450
    Try Request.UserHostAddress. You can also take a look at this article:
    Finding IP Address Information
    Welcome to my SQL/ASPNET forum for Chinese
    http://51up.org/bbs/forumdisplay.php?fid=38
  • Re: How to find external IP of a machine in ASP.Net 2003?

    12-15-2006, 5:08 AM

    No it also gives internal IP.

    It has written me 127.0.0.1 and my static IP is 202.189.232.149.

    Just see the link - http://whatismyipaddress.com
    Here you will get your machine's IP address and I want this IP address.

  • Re: How to find external IP of a machine in ASP.Net 2003?

    12-21-2006, 9:14 PM
    • Star
      12,930 point Star
    • Iori_Jay
    • Member since 04-04-2006, 10:21 AM
    • Posts 2,450
    If I run the website from VS IDE, I also get 127.0.0.1 for the IP address. Meanwhile if l visis the website directly from browser, it shows my external IP address. Have you tried to link in my previous post?
    Welcome to my SQL/ASPNET forum for Chinese
    http://51up.org/bbs/forumdisplay.php?fid=38
  • Re: How to find external IP of a machine in ASP.Net 2003?

    12-21-2006, 11:43 PM
    No it doesn't gives external IP.
  • Re: How to find external IP of a machine in ASP.Net 2003?

    03-20-2007, 9:03 AM

    Ok let me clear my doubt that I want the external IP address of my server. Its reason is -

    On my LAN server there are few telephone records in the form of wav files. Now I used to play selected file in windows media player plug in by giving it a URL like this - http://192.168.1.16/MIS/Wav/CH1/128.wav

    That record is played only locally (i.e. on LAN)

    But now I deployed it on main server i.e. on 59.95.73.97 machine here also there are same wav files.

    But now problem is that I create that URL through coding. In this I find the server's IP address using -

    sServerIP = Request.ServerVariables("LOCAL_ADDR")

    But it returns 192.168.1.14 i.e. internal IP address of that server instead of this I want its external IP address as - 59.95.73.97

    So please tell me how to find that external IP address or how to play those records in that window media player's plug in.

     

  • Re: How to find external IP of a machine in ASP.Net 2003?

    08-08-2007, 8:45 AM

    I'm also having same problem. i would liket to know the external(static) ip address of the server on which the website is hosted using .net. in application_start event i identify the ip adress of the server and make siteURL using it and using it as reference or say Virtual Address of the website in whole application.

     

     

     

     

    Amit Andharia
    Team Leader, Web Development
    http://amit-andharia.blogspot.com/
    http://journeythroughdotnet.wordpress.com/

Page 1 of 1 (7 items)