易截截图软件、单文件、免安装、纯绿色、仅160KB

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

 try
    {
        // 要提交表单的URI字符串。
        string uriString = "http://localhost:1165/WebTest/MyLogin.aspx";
        ///////////////////////////////////////
        // 打开页面
        ///////////////////////////////////////
        WebClient webClient = new WebClient();
        byte[] responseData = webClient.DownloadData(uriString);
        string srcString = Encoding.UTF8.GetString(responseData);
        ///////////////////////////////////////
        // 填写页面并提交
        ///////////////////////////////////////
        webClient = new WebClient();
        webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
        // 获取页面的 VeiwState                
        string viewStateFlag = "id=\"__VIEWSTATE\" value=\"";
        int i = srcString.IndexOf(viewStateFlag) + viewStateFlag.Length;
        int j = srcString.IndexOf("\"",i);
        string viewState = srcString.Substring(i, j-i);
    &nb


相关文档:

在asp.net中怎样跳转框架

我有一个login.aspx的页面,假如登录成功后就会自动跳转到index.html的框架. 
index.html有三个页面,top.aspx,left.aspx,main.aspx,然后left.aspx里面显示用户信息 
假如在left.aspx里没有Session的话,会返回login.aspx页面,而不显示index.html页面里的任何一页. 
我现在的情况是没有Session的时候还是在i ......

ASP.NET中解决传递中文参数

1.设置web.config文件.
<system.web>
......
<globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" fileEncoding="gb2312" />
......
</system.web>
 
或者:
aspx文件中:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"&g ......

ASP.net 4.0 针对SEO的改进

搜索引擎优化对任何面向公众的网站来说都非常重要,ASP.net 4.0 为此就做了大量改造。这些改进包括如下: 301永久性重定向 随着时间的迁移,网站的一些页面地址会发生变化,这会导致搜索引擎收录的链接地址、用户收藏的地址失效。Response.Redirect() 就是解决这个问题的。但是Response.Redirect 有以下问题: Response. ......

asp.net 中 request 与 context.request有什么区别?

Request 属性提供对 HttpRequest 类的属性和方法的编程访问。由于 ASP.NET 页包含对 System.Web 命名空间(含有 HttpContext 类)的默认引用,因此在 .aspx 页上可以引用 HttpContext 的成员,而不需要对 HttpContext 的完全限定类引用。例如,可只使用 Request.Browser 获取客户端浏览器的功能。但是,如果要从 ASP.NET 代 ......

Online active users counter in ASP.NET


Online active users counter in ASP.NET
With this tool which is written for ASP.NET, it is possible to count the number of online users, members and guest users in web sites.
Installation
The tool installation is very simple and only takes a few minutes.
Step one - Add Reference:
After downlo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号