码迷,mamicode.com
首页 >  
搜索关键字:webrequest    ( 197个结果
C# Winform程序获取外网IP地址
string strUrl = "http://www.ip138.com/ip2city.asp"; //获得IP的网址了 Uri uri = new Uri(strUrl); System.Net.WebRequest wr = System.Net.WebRequest.Create(uri)
分类:Windows程序   时间:2016-03-13 00:48:44    阅读次数:248
Http 请求
1 public static string HttpGet(string url) 2 { 3 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 4 request.Method = "GET";//设置请求的方法 5
分类:Web程序   时间:2016-03-06 23:33:02    阅读次数:212
C#(Winform) Http 发送数据
Get方式 private string HttpGet(string url, string postData) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url + (postData == "" ? "" : "?
分类:Windows程序   时间:2016-02-19 15:50:13    阅读次数:211
自己封装的HttpRequest,个人觉的比较HttpHelper好用
新年开篇,忙归忙,还是要写点什么,不然越来越懒,分享我写的HttpTooler public delegate void RequestCompleted(object sender, string html); public enum RequestType { WebRequest, HttpC
分类:Web程序   时间:2016-02-16 14:55:34    阅读次数:491
使用WebRequest对象调用新浪天气预报<转>
// 待请求的地址string url = "http://www.cnblogs.com"; // 创建 WebRequest 对象,WebRequest 是抽象类,定义了请求的规定,// 可以用于各种请求,例如:Http, Ftp 等等。// HttpWebRequest...
分类:Web程序   时间:2016-01-25 11:19:23    阅读次数:136
使用IHTMLDocument2解决弹出"为了让该网站给你提供个人化信息,是否允许在你计算机放置cookie?"
mshtml可以说是一个不错的解析html利器,对于像我这样一直都是不用webbrowser,直接用socket或者WebRequest进行HTTP通讯然后再用IHTMLDocument2.write(html)载入得到的html源进行解析.但是今天碰到一个问题,就是载入html到IHTMLDocu...
分类:Web程序   时间:2016-01-08 07:03:12    阅读次数:318
利用WebRequest类上传文件
说明:1.WebRequest类是一个抽象类,所以上传类实际使用的是其子类2.打开Fiddler软件,监视正常网页的文件上传,可以看到http协议的请求和响应信息,简略说明(第一行:请求说明POST http://localhost/UpLoad.aspx HTTP/1.1 (请求类型:post,请...
分类:Web程序   时间:2015-12-14 12:17:02    阅读次数:146
验证视图状态 MAC 失败
起因:最近在做一个项目需要用到生成多个Html页,采用一下方法动态生成。 WebRequest request = WebRequest.Create(pageurl); WebResponse response = request.GetResponse(); Stream resst...
分类:系统相关   时间:2015-12-08 18:32:31    阅读次数:188
ThreadPool.QueueUserWorkItem
ThreadPool.QueueUserWorkItem(_ =>{HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.baidu/tag/模特?page=" + pageNum);request.Creden...
分类:其他好文   时间:2015-12-05 21:04:29    阅读次数:180
C# 取得网址源码
HttpWebRequest wwb = (HttpWebRequest)WebRequest.Create(url); wwb.UserAgent = "Mozilla/5.0";//用户代理;与浏览器相关;没有的话,可能会导致GetResponse() ...
分类:Windows程序   时间:2015-12-03 14:02:10    阅读次数:148
197条   上一页 1 ... 8 9 10 11 12 ... 20 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!