夏雷

积极人生,努力加油!

2008年12月2日

使用WebClient自动填写并提交ASP.NET页面表单

摘要: 使用WebClient自动填写并提交ASP.NET页面表单 在.NET中通过程序填写和提交表单还是比较简单。比如,要提交一个如下图所示的登录表单: 填写和提交以上表单的代码如下: // 要提交表单的URI字符串。 string uriString = "http://www.xxx.com/Login.aspx"; ... 阅读全文

posted @ 2008-12-02 15:51 夏雷 阅读(266) 评论(0) 推荐(0) 编辑
WebClient 保持 Session 和 Cookie

摘要: 有些朋友说 WebClient 不能保持 Session 和 Cookie,只有 HttpWebRequest 才能保持 Session。实际上我们只要重写 WebClient 的 GetWebRequest 方法就可以使 WebClient 保持 Session 和 Cookie。 下面是 HttpClient 类, 它继承自 WebClient,并重写了 GetWebRequest 方法。关... 阅读全文

posted @ 2008-12-02 15:50 夏雷 阅读(806) 评论(0) 推荐(0) 编辑
WebClient读取网页

摘要: WebClient Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> WebClient client = new WebClient(); Stream stream = client.OpenRead("http://www... 阅读全文

posted @ 2008-12-02 15:49 夏雷 阅读(297) 评论(0) 推荐(0) 编辑
c#图片上传和加水印

摘要: 添加一个FileUpload控件,然后再添加一个image控件 //上传图片 protected void BtnUpload_Click(object sender, EventArgs e) { //上传图片 //取出文件路径 string FileFullName = this.FileUpload1.PostedF... 阅读全文

posted @ 2008-12-02 15:43 夏雷 阅读(755) 评论(0) 推荐(0) 编辑