Get users IP address

Rate It (5)

Last post 11-10-2009 1:24 PM by alikhanweb. 54 replies.

Sort Posts:

  • Get users IP address

    06-11-2005, 11:06 AM
    • Member
      115 point Member
    • J-sun Bailey
    • Member since 10-18-2004, 11:54 AM
    • Posts 23
    I need to modify the Send Thoughts module so that I will get the users public IP address.

    Can someone please provide some light on how I might accomplish this?

  • Re: Get users IP address

    06-16-2005, 8:15 AM
    • Member
      10 point Member
    • jbowen
    • Member since 12-19-2002, 5:34 PM
    • Michigan, US
    • Posts 2

    You may be able accomplish what you want using the Request.Servervariables("REMOTE_ADDR") header.

    These may help:
    http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=577
    http://www.w3schools.com/asp/coll_servervariables.asp

  • Re: Get users IP address

    08-19-2006, 1:27 PM
    • All-Star
      22,244 point All-Star
    • vik20000in
    • Member since 12-30-2005, 6:02 AM
    • Kolkata
    • Posts 3,463
    • TrustedFriends-MVPs
    This link will be useful
    http://www.vikramlakhotia.com/Post.aspx?postID=12
    Vikram
    www.vikramlakhotia.com


    Please mark the answer if it helped you
  • Re: Get users IP address

    10-30-2006, 3:41 AM
    • Contributor
      2,551 point Contributor
    • etariq
    • Member since 11-14-2005, 8:44 AM
    • Amman
    • Posts 457

    HttpContext.Current.Request.UserHostAddress;
    or
    HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

    To get the IP address of the machine and not the proxy use the following code

    HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

    A fine is a tax for doing wrong. A tax is a fine for doing well.
    __________________________________________________
    Please remember to click “Mark as Answer” on the post that helps you.
  • Re: Get users IP address

    07-10-2007, 1:00 PM
    • Contributor
      3,374 point Contributor
    • mychucky
    • Member since 03-20-2006, 9:01 PM
    • Posts 2,475

    etariq:
    HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

    I tried that and it didn't work. No IP address is showing.

  • Re: Get users IP address

    07-13-2007, 9:33 AM
    • Contributor
      3,692 point Contributor
    • eramseur
    • Member since 10-09-2004, 12:36 AM
    • Washington DC
    • Posts 752

    Take a look at the log module as it shows IP information.  You can just copy that functionality. 

  • Re: Get users IP address

    07-13-2007, 9:54 AM
    • Contributor
      3,374 point Contributor
    • mychucky
    • Member since 03-20-2006, 9:01 PM
    • Posts 2,475

    Not sure what you mean by log module. Where do I look for and what do I need to copy?

  • Re: Get users IP address

    07-13-2007, 10:18 AM
    • Contributor
      3,692 point Contributor
    • eramseur
    • Member since 10-09-2004, 12:36 AM
    • Washington DC
    • Posts 752

    Rainbow has a log module.  You can find this on the portal by going on the Admin menu and clicking on logs and then  Monitoring and Logs.   This will show you IP info and you can get the functionality from DesktopModules\Monitoring.

  • Re: Get users IP address

    07-13-2007, 10:25 AM
    • Contributor
      3,374 point Contributor
    • mychucky
    • Member since 03-20-2006, 9:01 PM
    • Posts 2,475

    I'm still not clear what you mean. I don't have admin rights to the web server. I only have rights to my own little web space. So I'm not sure what you mean by admin menu or DesktopModules\Monitorings.

  • Re: Get users IP address

    07-13-2007, 10:29 AM
    • Contributor
      3,692 point Contributor
    • eramseur
    • Member since 10-09-2004, 12:36 AM
    • Washington DC
    • Posts 752

    When you login to rainbow, you see the admin menu correct?   Off of the admin menu is a logs tab, off the logs tab is monitoring.  I dont mean admin to the server; I mean admin to your portal. 

  • Re: Get users IP address

    01-08-2008, 1:42 AM
    Cheers!
    Bala

    http://balanagaraj.wordpress.com
  • Re: Get users IP address

    01-24-2008, 1:16 PM
    • Member
      27 point Member
    • vitta
    • Member since 06-23-2006, 4:36 PM
    • Posts 13

    Even I have simillar kind of problem.
    We have intranet application and I need to cature the  IPAddress of the client.

    I am trying to capture the remote address.
    I tried  in different ways as below.. but the result of all is 127.0.0.1

    HttpContext.Current.Request.ServerVariables(
    "REMOTE_ADDR")
    Request.ServerVariables("REMOTE_HOST")
    Request.UserHostAddress()
    Request.UserHostName()

    I guess firewall/NAT Box hiding internal IP addresses.
    is there any way to get actual IP.

    Thanks in advance.



     

     

  • Re: Get users IP address

    01-29-2008, 6:37 AM
    • Member
      404 point Member
    • ovaisgeo
    • Member since 11-14-2007, 5:55 AM
    • Pakistan
    • Posts 140

    HttpContext.Current.Request.ServerVariables("REMOTE_ADDR")

  • Re: Get users IP address

    02-06-2008, 8:54 AM
    • Member
      72 point Member
    • zestq
    • Member since 10-26-2004, 2:08 AM
    • karachi
    • Posts 47

    Hi vitta, I got the same problem and I found the solution by doing dis:

                    string strHostName = System.Net.Dns.GetHostName();
                    string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();

    I got this solution from C# corner. website

    Filed under:
  • Re: Get users IP address

    02-12-2008, 2:22 AM
    • Member
      16 point Member
    • satender88
    • Member since 02-04-2008, 7:22 AM
    • Posts 46

    This example demonstrates how to find out the visitor's browser type, IP address, and more:

    <html>
    <body>
    <p>
    <b>You are browsing this site with:</b>
    <%Response.Write(Request.ServerVariables("http_user_agent"))%>
    </p>
    <p>
    <b>Your IP address is:</b>
    <%Response.Write(Request.ServerVariables("remote_addr"))%>
    </p>
    <p>
    <b>The DNS lookup of the IP address is:</b>
    <%Response.Write(Request.ServerVariables("remote_host"))%>
    </p>
    <p>
    <b>The method used to call the page:</b>
    <%Response.Write(Request.ServerVariables("request_method"))%>
    </p>
    <p>
    <b>The server's domain name:</b>
    <%Response.Write(Request.ServerVariables("server_name"))%>
    </p>
    <p>
    <b>The server's port:</b>
    <%Response.Write(Request.ServerVariables("server_port"))%>
    </p>
    <p>
    <b>The server's software:</b>
    <%Response.Write(Request.ServerVariables("server_software"))%>
    </p>
    </body>
    </html>
    Filed under:
Page 1 of 4 (55 items) 1 2 3 4 Next >