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

前端 未结 4 841
攒了一身酷
攒了一身酷 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:42

    That code will get you the IP address of the server.

    You can access the user's IP address with this property: Request.UserHostAddress

提交回复
热议问题