[C#] 纯文本查看 复制代码 public static bool IpTest(string url, string strProxyIp)
{
//创建Httphelper对象
HttpHelper http = new HttpHelper();
//创建Httphelper参数对象
HttpItem item = new HttpItem()
{
URL = url,//URL 必需项
Method = "get",//URL 可选项 默认为Get
ContentType = "text/html",//返回类型 可选项有默认值
ProxyIp = strProxyIp,
//ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
};
//请求的返回值对象
HttpResult result = http.FastRequest(item);
//状态码
HttpStatusCode code = result.StatusCode;
if (code == HttpStatusCode.OK)
{
return true;
}
else
{
return false;
}
参数是正确的,值是正确的,网址也是正确的可以打开的,这是为什么?
|