读取WWW安全ASP页面的简单应用程序 [英] Simple application for reading WWW secured ASP page

查看:60
本文介绍了读取WWW安全ASP页面的简单应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想用C#编写应用程序,以从指定的URL检索WWW页面.
我写了一个简单的应用程序.它将WWW页面检索为HTML源.但是我有一个大问题.我不知道如何使我的简单程序通过ASP页上的身份验证.

这个应用程序的目的是连接到我的帐户,然后转到服务中的指定位置,并检查指定文档的状态.

Hi,

I''d like to write app in C# for retreiving WWW page from specified URL.
I''ve written simple app. It retrieves WWW page as a HTML source. But I''ve one big problem. I don''t know how to make my simple program to pass thru authentication on ASP page.

Idea of this app is to connect to my account, and then to go to the specified place in the service and to chceck the status of specified documentation.

推荐答案

是什么您尝试连接到的Web应用程序所使用的身份验证机制?最有可能您将提交用户名和密码,如果使用该用户名和密码(POST方法)对该网页进行SUBMIT,则可以实现此目的,但是最终您需要知道您所使用的字段的名称.发布.

您可以使用HttpClient连接到该页面并提交数据,请记住在这种情况下您将没有UI.
What is the authentication mechanism used for the web application that you are trying to connect to ?! most probably you will submit a user name and a password, this will be achieved if you do a SUBMIT with the user name and password (POST method) to that web page, but eventually you will need to know the names of the fields you are posting.

You could use an HttpClient to connect to that page and submit your data, taking in mind that you will have no UI in this case.


因为您没有显示任何代码,假设您正在使用WebClient访问远程站点.在这种情况下,您需要使用凭据属性来提供适当的身份验证凭据

http://msdn.microsoft.com/en-us/library/system. net.webclient.credentials.aspx [ ^ ]
Since you haven''t shown any code I''ll assume you are using WebClient to access the remote site. In which case you need to use the Credentials property to supply the proper authentication credentials

http://msdn.microsoft.com/en-us/library/system.net.webclient.credentials.aspx[^]


我正在使用WebClient检索页面.

该页面具有基于会话的身份验证机制.
I''m using WebClient to retreive page.

The page has session based authentication mechanism.


这篇关于读取WWW安全ASP页面的简单应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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