feifeiwzh

 
 

Powered by: 博客园
模板提供:沪江博客
博客园 | 首页 | 发新随笔 | 发新文章 | 联系 | 订阅订阅 | 管理

06 2009 档案

 
webClient上载下载
摘要: Net2.0中新增了很多组件,WebClient就是其中一个,功能也很强大,今天拿WebClient做了一个小实验,只用到了一些很简单的功能就可以实现以前不好实现的功能,很方便。 简单介绍一下WebClient:WebClient 类提供向 URI 标识的任何本地、Intranet 或 Internet 资源发送数据以及从这些资源接收数据的公共方法。WebClient 类使用 WebRequest...阅读全文
posted @ 2009-06-14 15:52 我是农民 阅读(1120) | 评论 (0) 编辑
WebClient.UploadData 方法 上载文件数据
摘要: WebClient.UploadData 方法 上载文件数据 假如某网站有个表单,例如(url: http://localhost/login.aspx):帐号密码我们需要在程序中提交数据到这个表单,对于这种表单,我们可以使用 WebClient.UploadData 方法来实现,将所要上传的数据拼成字符即可,程序很简单:string uriString = "http://localhost/l...阅读全文
posted @ 2009-06-14 15:48 我是农民 阅读(225) | 评论 (0) 编辑
webclient提交并接受返回
摘要: string url = "http://yoowiki.com/check.php?cmd=add&username=" + this.txt_userName.Text + "&password=" + System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_pwd....阅读全文
posted @ 2009-06-14 15:16 我是农民 阅读(98) | 评论 (0) 编辑
使用WebClient自动填写并提交ASP.NET页面表单
摘要: 使用WebClient自动填写并提交ASP.NET页面表单 在.NET中通过程序填写和提交表单还是比较简单。比如,要提交一个如下图所示的登录表单: 填写和提交以上表单的代码如下://要提交表单的URI字符串。stringuriString="http://www.xxx.com/Login.aspx";//要提交的字符串数据。stringpostString="userName=user1&am...阅读全文
posted @ 2009-06-14 14:37 我是农民 阅读(395) | 评论 (1) 编辑
asp.net去掉HTML标记
摘要: using System;using System.Web;using System.Text.RegularExpressions;public static string NoHTML(string Htmlstring) { //删除脚本 Htmlstring = Regex.Replace(Htmlstring,@"<script[^>]*?>.*?</scr...阅读全文
posted @ 2009-06-11 11:43 我是农民 阅读(449) | 评论 (0) 编辑