how to get the user's ip address on web server?

前端 未结 4 847
攒了一身酷
攒了一身酷 2021-01-15 19:18

I have a problem to get the user\'s ip address into web server. I am using this code..

//To get the local IP address 
            string sHostName = Dns.Get         


        
4条回答
  •  太阳男子
    2021-01-15 19:38

    No matter how hard you try you can only get server IP using server side code in Asp.Net.However the method told in this article will let you access client ip using javascript.refer this https://www.c-sharpcorner.com/blogs/getting-client-ip-address-or-local-ip-address-in-javascript

提交回复
热议问题