Example #1
0
 private void btnWininet_Click(object sender, EventArgs e)
 {
     Random r = new Random();
     Wininet wnet = new Wininet();
     pic.Image = wnet.GetImage(picurl);
 }
Example #2
0
 private void btnProxy_Click(object sender, EventArgs e)
 {
     string url = "http://1111.ip138.com/ic.asp"; //请求地址
     string ip = "127.0.0.1:8888"; //设置代理IP地址
     HttpItems item = new HttpItems();
     item.URL = url;
     item.ProxyIp = ip;
     //如果代理服务器需要用户名与密码请参考此设置
     //item.ProxyUserName = "******";//如果代理服务器需要用户名
     //item.ProxyPwd = "密码";//如果代理服务器需要密码
     HttpResults hr = http.GetHtml(item);
     // hr.Html; 请求具体结果
     Wininet winet = new Wininet();
     //Post
     string postdata = "GetHtmlPro 如果传入PostData参数则认为当前是Post请求";
     string Posthtml = winet.GetDataPro(winet.GetHtmlPro(url, postdata, ip));
     //Get
     string Gethtml = winet.GetDataPro(winet.GetHtmlPro(url, "", ip));
     //使用代理请求图片时
     Image img = winet.GetImage(winet.GetHtmlPro("图片URL", "", ip));
 }