| 
 | 
 
 
 楼主 |
发表于 2016-11-29 22:09:46
|
显示全部楼层
 
 
 
 
 HttpHelper http = new HttpHelper(); 
            HttpItem item = new HttpItem() 
            { 
                URL = url,//URL     必需项   
                Method = "POST",//URL     可选项 默认为Get   
                Postdata = data,//Post数据     可选项GET时不需要写 
                ContentType = "application/x-www-form-urlencoded",//返回类型    可选项有默认值 
            }; 
            item.Header.Add("sr", "taokexia");//设置请求头信息(Header) 
            HttpResult result = http.GetHtml(item); 
            string html = result.Html; 
  if (result.StatusCode == System.Net.HttpStatusCode.OK) 
             { 
                 label2.Text = "已经链接"; 
                 metroDMButton1.Enabled = true; 
             } |   
 
 
 
 |