How to get Client or visitor IP Address:: Despite multiple tries Didn't get solution:












1















How to get Client or visitor IP Address:: Despite multiple tries Didn't get solution: Below what I tried:



public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ipAddress33 = Request.UserHostAddress.ToString();
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress22 = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
Response.Write("System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : " + clientIPAddress22 + "<br />");
string ipaddress;
string IP = Request.UserHostAddress;
string clientIPAddress = this.Page.Request.ServerVariables["REMOTE_ADDR"];
string IP2 = Environment.GetEnvironmentVariable("CLIENTNAME");

ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipaddress == "" || ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];
Response.Write("Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : " + ipaddress + "<br />");
Response.Write("Request.UserHostAddress.ToString() : " + ipAddress33 + "<br />");

string stringIpAddress;
stringIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (stringIpAddress == null) //may be the HTTP_X_FORWARDED_FOR is null
{
stringIpAddress = Request.ServerVariables["REMOTE_ADDR"];//we can use REMOTE_ADDR
}
Response.Write("Request.ServerVariables['REMOTE_ADDR'] : " + stringIpAddress + "<br />");

//Get the Host Name
string stringHostName = Dns.GetHostName();
//Get The Ip Host Entry
IPHostEntry ipHostEntries = Dns.GetHostEntry(stringHostName);
//Get The Ip Address From The Ip Host Entry Address List
IPAddress arrIpAddress = ipHostEntries.AddressList;
Response.Write("Dns.GetHostName(): " + arrIpAddress[arrIpAddress.Length - 1].ToString());

}

}




This is the results I got:



System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : 190.80.90.75
Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : 190.80.90.225
Request.UserHostAddress.ToString() : 190.80.90.225
Request.ServerVariables['REMOTE_ADDR'] : 190.80.90.225
Dns.GetHostName(): 190.80.90.75




Which is not the correct IP address of the visitor.










share|improve this question























  • How do you know that the address is wrong?

    – Nico Schertler
    Nov 20 '18 at 7:59











  • I matched with the LAN IP address provided to the system and it didn't matched

    – sunil492307
    Nov 20 '18 at 10:35













  • The global IP address that your computer uses to communicate with the internet is most likely not the same as the local one in your LAN.

    – Nico Schertler
    Nov 20 '18 at 14:03











  • Thanks Nico schertler, I came to know that when we are using subnets and firewalls, it is not possible to get the clients ip address i.e lan ip address.

    – sunil492307
    Nov 20 '18 at 17:40


















1















How to get Client or visitor IP Address:: Despite multiple tries Didn't get solution: Below what I tried:



public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ipAddress33 = Request.UserHostAddress.ToString();
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress22 = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
Response.Write("System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : " + clientIPAddress22 + "<br />");
string ipaddress;
string IP = Request.UserHostAddress;
string clientIPAddress = this.Page.Request.ServerVariables["REMOTE_ADDR"];
string IP2 = Environment.GetEnvironmentVariable("CLIENTNAME");

ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipaddress == "" || ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];
Response.Write("Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : " + ipaddress + "<br />");
Response.Write("Request.UserHostAddress.ToString() : " + ipAddress33 + "<br />");

string stringIpAddress;
stringIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (stringIpAddress == null) //may be the HTTP_X_FORWARDED_FOR is null
{
stringIpAddress = Request.ServerVariables["REMOTE_ADDR"];//we can use REMOTE_ADDR
}
Response.Write("Request.ServerVariables['REMOTE_ADDR'] : " + stringIpAddress + "<br />");

//Get the Host Name
string stringHostName = Dns.GetHostName();
//Get The Ip Host Entry
IPHostEntry ipHostEntries = Dns.GetHostEntry(stringHostName);
//Get The Ip Address From The Ip Host Entry Address List
IPAddress arrIpAddress = ipHostEntries.AddressList;
Response.Write("Dns.GetHostName(): " + arrIpAddress[arrIpAddress.Length - 1].ToString());

}

}




This is the results I got:



System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : 190.80.90.75
Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : 190.80.90.225
Request.UserHostAddress.ToString() : 190.80.90.225
Request.ServerVariables['REMOTE_ADDR'] : 190.80.90.225
Dns.GetHostName(): 190.80.90.75




Which is not the correct IP address of the visitor.










share|improve this question























  • How do you know that the address is wrong?

    – Nico Schertler
    Nov 20 '18 at 7:59











  • I matched with the LAN IP address provided to the system and it didn't matched

    – sunil492307
    Nov 20 '18 at 10:35













  • The global IP address that your computer uses to communicate with the internet is most likely not the same as the local one in your LAN.

    – Nico Schertler
    Nov 20 '18 at 14:03











  • Thanks Nico schertler, I came to know that when we are using subnets and firewalls, it is not possible to get the clients ip address i.e lan ip address.

    – sunil492307
    Nov 20 '18 at 17:40
















1












1








1


1






How to get Client or visitor IP Address:: Despite multiple tries Didn't get solution: Below what I tried:



public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ipAddress33 = Request.UserHostAddress.ToString();
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress22 = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
Response.Write("System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : " + clientIPAddress22 + "<br />");
string ipaddress;
string IP = Request.UserHostAddress;
string clientIPAddress = this.Page.Request.ServerVariables["REMOTE_ADDR"];
string IP2 = Environment.GetEnvironmentVariable("CLIENTNAME");

ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipaddress == "" || ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];
Response.Write("Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : " + ipaddress + "<br />");
Response.Write("Request.UserHostAddress.ToString() : " + ipAddress33 + "<br />");

string stringIpAddress;
stringIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (stringIpAddress == null) //may be the HTTP_X_FORWARDED_FOR is null
{
stringIpAddress = Request.ServerVariables["REMOTE_ADDR"];//we can use REMOTE_ADDR
}
Response.Write("Request.ServerVariables['REMOTE_ADDR'] : " + stringIpAddress + "<br />");

//Get the Host Name
string stringHostName = Dns.GetHostName();
//Get The Ip Host Entry
IPHostEntry ipHostEntries = Dns.GetHostEntry(stringHostName);
//Get The Ip Address From The Ip Host Entry Address List
IPAddress arrIpAddress = ipHostEntries.AddressList;
Response.Write("Dns.GetHostName(): " + arrIpAddress[arrIpAddress.Length - 1].ToString());

}

}




This is the results I got:



System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : 190.80.90.75
Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : 190.80.90.225
Request.UserHostAddress.ToString() : 190.80.90.225
Request.ServerVariables['REMOTE_ADDR'] : 190.80.90.225
Dns.GetHostName(): 190.80.90.75




Which is not the correct IP address of the visitor.










share|improve this question














How to get Client or visitor IP Address:: Despite multiple tries Didn't get solution: Below what I tried:



public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ipAddress33 = Request.UserHostAddress.ToString();
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress22 = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
Response.Write("System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : " + clientIPAddress22 + "<br />");
string ipaddress;
string IP = Request.UserHostAddress;
string clientIPAddress = this.Page.Request.ServerVariables["REMOTE_ADDR"];
string IP2 = Environment.GetEnvironmentVariable("CLIENTNAME");

ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipaddress == "" || ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];
Response.Write("Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : " + ipaddress + "<br />");
Response.Write("Request.UserHostAddress.ToString() : " + ipAddress33 + "<br />");

string stringIpAddress;
stringIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (stringIpAddress == null) //may be the HTTP_X_FORWARDED_FOR is null
{
stringIpAddress = Request.ServerVariables["REMOTE_ADDR"];//we can use REMOTE_ADDR
}
Response.Write("Request.ServerVariables['REMOTE_ADDR'] : " + stringIpAddress + "<br />");

//Get the Host Name
string stringHostName = Dns.GetHostName();
//Get The Ip Host Entry
IPHostEntry ipHostEntries = Dns.GetHostEntry(stringHostName);
//Get The Ip Address From The Ip Host Entry Address List
IPAddress arrIpAddress = ipHostEntries.AddressList;
Response.Write("Dns.GetHostName(): " + arrIpAddress[arrIpAddress.Length - 1].ToString());

}

}




This is the results I got:



System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); : 190.80.90.75
Request.ServerVariables['HTTP_X_FORWARDED_FOR'] : 190.80.90.225
Request.UserHostAddress.ToString() : 190.80.90.225
Request.ServerVariables['REMOTE_ADDR'] : 190.80.90.225
Dns.GetHostName(): 190.80.90.75




Which is not the correct IP address of the visitor.







c# vb.net






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 '18 at 6:23









sunil492307sunil492307

13




13













  • How do you know that the address is wrong?

    – Nico Schertler
    Nov 20 '18 at 7:59











  • I matched with the LAN IP address provided to the system and it didn't matched

    – sunil492307
    Nov 20 '18 at 10:35













  • The global IP address that your computer uses to communicate with the internet is most likely not the same as the local one in your LAN.

    – Nico Schertler
    Nov 20 '18 at 14:03











  • Thanks Nico schertler, I came to know that when we are using subnets and firewalls, it is not possible to get the clients ip address i.e lan ip address.

    – sunil492307
    Nov 20 '18 at 17:40





















  • How do you know that the address is wrong?

    – Nico Schertler
    Nov 20 '18 at 7:59











  • I matched with the LAN IP address provided to the system and it didn't matched

    – sunil492307
    Nov 20 '18 at 10:35













  • The global IP address that your computer uses to communicate with the internet is most likely not the same as the local one in your LAN.

    – Nico Schertler
    Nov 20 '18 at 14:03











  • Thanks Nico schertler, I came to know that when we are using subnets and firewalls, it is not possible to get the clients ip address i.e lan ip address.

    – sunil492307
    Nov 20 '18 at 17:40



















How do you know that the address is wrong?

– Nico Schertler
Nov 20 '18 at 7:59





How do you know that the address is wrong?

– Nico Schertler
Nov 20 '18 at 7:59













I matched with the LAN IP address provided to the system and it didn't matched

– sunil492307
Nov 20 '18 at 10:35







I matched with the LAN IP address provided to the system and it didn't matched

– sunil492307
Nov 20 '18 at 10:35















The global IP address that your computer uses to communicate with the internet is most likely not the same as the local one in your LAN.

– Nico Schertler
Nov 20 '18 at 14:03





The global IP address that your computer uses to communicate with the internet is most likely not the same as the local one in your LAN.

– Nico Schertler
Nov 20 '18 at 14:03













Thanks Nico schertler, I came to know that when we are using subnets and firewalls, it is not possible to get the clients ip address i.e lan ip address.

– sunil492307
Nov 20 '18 at 17:40







Thanks Nico schertler, I came to know that when we are using subnets and firewalls, it is not possible to get the clients ip address i.e lan ip address.

– sunil492307
Nov 20 '18 at 17:40














2 Answers
2






active

oldest

votes


















0














according to this answer you can use this :



  protected void GetUser_IP()
{
string VisitorsIPAddr = string.Empty;
if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
{
VisitorsIPAddr = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
{
VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress;
}
uip.Text = "Your IP is: " + VisitorsIPAddr;
}





share|improve this answer
























  • Using the above snippet: I got result as "Your IP is: ::1"

    – sunil492307
    Nov 20 '18 at 10:09











  • ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

    – FarhadMohseni
    Nov 20 '18 at 12:05













  • Thanks FarhadMoheseni.

    – sunil492307
    Nov 20 '18 at 17:41



















0














VB.Net Version::
-----------------------------------------------
Shared Sub GetUser_IP()
If HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR") IsNot Nothing Then
VisitorsIPAddr = HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR").ToString()
ElseIf HttpContext.Current.Request.UserHostAddress.Length <> 0 Then
VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress
End If
End Sub





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387356%2fhow-to-get-client-or-visitor-ip-address-despite-multiple-tries-didnt-get-solu%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    according to this answer you can use this :



      protected void GetUser_IP()
    {
    string VisitorsIPAddr = string.Empty;
    if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
    {
    VisitorsIPAddr = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
    }
    else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
    {
    VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress;
    }
    uip.Text = "Your IP is: " + VisitorsIPAddr;
    }





    share|improve this answer
























    • Using the above snippet: I got result as "Your IP is: ::1"

      – sunil492307
      Nov 20 '18 at 10:09











    • ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

      – FarhadMohseni
      Nov 20 '18 at 12:05













    • Thanks FarhadMoheseni.

      – sunil492307
      Nov 20 '18 at 17:41
















    0














    according to this answer you can use this :



      protected void GetUser_IP()
    {
    string VisitorsIPAddr = string.Empty;
    if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
    {
    VisitorsIPAddr = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
    }
    else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
    {
    VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress;
    }
    uip.Text = "Your IP is: " + VisitorsIPAddr;
    }





    share|improve this answer
























    • Using the above snippet: I got result as "Your IP is: ::1"

      – sunil492307
      Nov 20 '18 at 10:09











    • ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

      – FarhadMohseni
      Nov 20 '18 at 12:05













    • Thanks FarhadMoheseni.

      – sunil492307
      Nov 20 '18 at 17:41














    0












    0








    0







    according to this answer you can use this :



      protected void GetUser_IP()
    {
    string VisitorsIPAddr = string.Empty;
    if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
    {
    VisitorsIPAddr = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
    }
    else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
    {
    VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress;
    }
    uip.Text = "Your IP is: " + VisitorsIPAddr;
    }





    share|improve this answer













    according to this answer you can use this :



      protected void GetUser_IP()
    {
    string VisitorsIPAddr = string.Empty;
    if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
    {
    VisitorsIPAddr = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
    }
    else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
    {
    VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress;
    }
    uip.Text = "Your IP is: " + VisitorsIPAddr;
    }






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 20 '18 at 7:58









    FarhadMohseniFarhadMohseni

    215




    215













    • Using the above snippet: I got result as "Your IP is: ::1"

      – sunil492307
      Nov 20 '18 at 10:09











    • ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

      – FarhadMohseni
      Nov 20 '18 at 12:05













    • Thanks FarhadMoheseni.

      – sunil492307
      Nov 20 '18 at 17:41



















    • Using the above snippet: I got result as "Your IP is: ::1"

      – sunil492307
      Nov 20 '18 at 10:09











    • ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

      – FarhadMohseni
      Nov 20 '18 at 12:05













    • Thanks FarhadMoheseni.

      – sunil492307
      Nov 20 '18 at 17:41

















    Using the above snippet: I got result as "Your IP is: ::1"

    – sunil492307
    Nov 20 '18 at 10:09





    Using the above snippet: I got result as "Your IP is: ::1"

    – sunil492307
    Nov 20 '18 at 10:09













    ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

    – FarhadMohseni
    Nov 20 '18 at 12:05







    ::1 is the loopback address in IPv6. the IPv6 version of 127.0.0.1 . if you running it on your local host , the result is normal

    – FarhadMohseni
    Nov 20 '18 at 12:05















    Thanks FarhadMoheseni.

    – sunil492307
    Nov 20 '18 at 17:41





    Thanks FarhadMoheseni.

    – sunil492307
    Nov 20 '18 at 17:41













    0














    VB.Net Version::
    -----------------------------------------------
    Shared Sub GetUser_IP()
    If HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR") IsNot Nothing Then
    VisitorsIPAddr = HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR").ToString()
    ElseIf HttpContext.Current.Request.UserHostAddress.Length <> 0 Then
    VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress
    End If
    End Sub





    share|improve this answer




























      0














      VB.Net Version::
      -----------------------------------------------
      Shared Sub GetUser_IP()
      If HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR") IsNot Nothing Then
      VisitorsIPAddr = HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR").ToString()
      ElseIf HttpContext.Current.Request.UserHostAddress.Length <> 0 Then
      VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress
      End If
      End Sub





      share|improve this answer


























        0












        0








        0







        VB.Net Version::
        -----------------------------------------------
        Shared Sub GetUser_IP()
        If HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR") IsNot Nothing Then
        VisitorsIPAddr = HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR").ToString()
        ElseIf HttpContext.Current.Request.UserHostAddress.Length <> 0 Then
        VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress
        End If
        End Sub





        share|improve this answer













        VB.Net Version::
        -----------------------------------------------
        Shared Sub GetUser_IP()
        If HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR") IsNot Nothing Then
        VisitorsIPAddr = HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR").ToString()
        ElseIf HttpContext.Current.Request.UserHostAddress.Length <> 0 Then
        VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress
        End If
        End Sub






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 3:58









        sunil492307sunil492307

        13




        13






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387356%2fhow-to-get-client-or-visitor-ip-address-despite-multiple-tries-didnt-get-solu%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith