国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

c#獲取真實IP和代理IP

2019-11-17 04:27:15
字體:
來源:轉載
供稿:網友

獲取真實ipview plaincopy to clipboardPRint?
public static string GetRealIP()  
{  
string ip;  
try 
{  
HttpRequest request = HttpContext.Current.Request;  
 
if (request.ServerVariables["HTTP_VIA"] != null)  
{  
ip = request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString().Split(',')[0].Trim();  
}  
else 
{  
ip = request.UserHostAddress;  
}  
}  
catch (Exception e)  
{  
throw e;  
}  
 
return ip;  

public static string GetRealIP()
{
string ip;
try
{
HttpRequest request = HttpContext.Current.Request;

if (request.ServerVariables["HTTP_VIA"] != null)
{
ip = request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString().Split(',')[0].Trim();
}
else
{
ip = request.UserHostAddress;
}
}
catch (Exception e)
{
throw e;
}

return ip;
}獲取代理IPview plaincopy to clipboardprint?
public static string GetViaIP()  
{  
string viaIp = null;  
 
try 
{  
HttpRequest request = HttpContext.Current.Request;  
 
if (request.ServerVariables["HTTP_VIA"] != null)  
{  
viaIp = request.UserHostAddress;  
}  
 
}  
catch (Exception e)  
{  
 
throw e;  
}  
 
return viaIp;


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黎城县| 龙海市| 高州市| 兴仁县| 屯留县| 东至县| 玛沁县| 清新县| 宜章县| 鸡泽县| 堆龙德庆县| 顺平县| 岢岚县| 富蕴县| 宜兰县| 灵山县| 永济市| 汕头市| 鸡西市| 黔南| 北票市| 会昌县| 广河县| 梨树县| 夏津县| 宜昌市| 固镇县| 德清县| 原平市| 北辰区| 远安县| 莎车县| 商城县| 乌拉特后旗| 邢台市| 南部县| 垫江县| 兴业县| 马鞍山市| 乐至县| 建水县|