bk控制变压器,青春荷尔蒙4,郝建小品全集
1.获取ip和端口
string str = (request.httpcontext.connection.localipaddress.maptoipv4().tostring() + ":" + request.httpcontext.connection.localport);
输出str,会得到当前服务器的ip及端口("127.0.0.1:5001")
2.获取ip
var ip = httpcontext.request.headers["x-forwarded-for"].firstordefault();
if (string.isnullorempty(ip))
{
ip = httpcontext.connection.remoteipaddress.tostring();
}
return ip; "127.0.0.1"
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
asp.net搭建博客,使用BlogEngine.NET+MySql搭建博客
网友评论