登录到远程asp.net网页 [英] Logging to remote asp.net Web Page

查看:156
本文介绍了登录到远程asp.net网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我wan't与HttpWebRequest的连接到远程Web页面(已登录表单)。
我使用本教程:<一href=\"http://www.byteblocks.com/page/How-to-submit-requests-to-web-sites-programatically-using-HttpWebRequest.aspx\" rel=\"nofollow\">http://www.byteblocks.com/page/How-to-submit-requests-to-web-sites-programatically-using-HttpWebRequest.aspx

I wan't to connect to remote web page (that has login form) with HttpWebRequest. I am using this tutorial: http://www.byteblocks.com/page/How-to-submit-requests-to-web-sites-programatically-using-HttpWebRequest.aspx

,但我不知道在哪里RequestAttributes类是属于?!

,but I don't know where RequestAttributes class belongs to?!?

有没有什么更好的方法来做到这一点?远程页面在ASP.NET,它使用窗体身份验证,当有人提出请求的Default.aspx它重定向它到登录页面。
我想分析Default.aspx页面,但我能够做到这一点之前,我需要通过凭据通过在HttpWebRequest的POST方法来登录表单。下面是一个使用POST方法传递参数的一个例子:<一href=\"http://www.worldofasp.net/tut/WebRequest/Working_with_HttpWebRequest_and_HttpWebResponse_in_ASPNET_114.aspx\" rel=\"nofollow\">http://www.worldofasp.net/tut/WebRequest/Working_with_HttpWebRequest_and_HttpWebResponse_in_ASPNET_114.aspx

Is there any better way to do this? The remote page is in ASP.NET, it's using Form authentication and when someone makes a request to default.aspx it redirects it to login page. I want to parse default.aspx page, but before I am able to do that, I need to pass credentials to login form via POST method in HttpWebRequest. Here is another example using POST method to pass parameters: http://www.worldofasp.net/tut/WebRequest/Working_with_HttpWebRequest_and_HttpWebResponse_in_ASPNET_114.aspx

但我不明白为什么这并不ASP.NET中远程页面的工作。

but I don't understand why this does not work in ASP.NET remote page.

推荐答案

有一个关于这个问题的一个伟大的文章,我已经解决了我的问题与此有关。如果有人在这里有同样的问题,它是:

There is a great article about this problem and I've solved my problem with this. If someone has the same problem here it is:

http://dotnet.sys-con.com/node/45127

这篇关于登录到远程asp.net网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆