vb.net和asp新手 [英] New to vb.net and asp

查看:98
本文介绍了vb.net和asp新手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用vb.net代码访问网页并传递登录名和密码才能进入下一页。然后我可以激活FTP加载程序。我的问题是如何写第一步进入网站。我真的不太了解.net并且需要将其作为第一步。

I need to use vb.net code to access a web page and pass a login and password to get to the next page. Then i can activate the FTP loader. My question is how would I write this first step to get into the site. I really dont know much .net and need to make this the first step.

推荐答案

要在您自己的网站上进行身份验证,请从这里开始: http://msdn.microsoft.com/en-us/library/eeyk640h%28v=vs。 100%29.aspx [ ^ ]。



此代码项目文章也可能有用: ASP.NET身份验证和授权 [ ^ ]。



用户通过身份验证后,需要访问其他一些网站并对其进行身份验证。这取决于该网站的要求(请参阅我对该问题的评论)。无论如何,如果你使用类 System.Net.HttpWebRequest ,你可以模拟任何用户的动作:

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx [<一个href =http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspxtarget =_ blanktitle =New Window> ^ ]。



最有可能的是,该网站有一些登录表格。如果您了解此表单(例如,使用浏览器的查看页面源),您可以了解所需的内容。在表单上,​​HTTP请求由具有name属性的控件组成。但是一般问题接近于网络抓取的问题:

http: //en.wikipedia.org/wiki/Web_scraping [ ^ ]。



请查看我过去的答案:

从网页获取特定数据 [ ^ ],

如何从其他网站获取数据 [ ^ ]。



-SA
For authentication on your own site, please start here: http://msdn.microsoft.com/en-us/library/eeyk640h%28v=vs.100%29.aspx[^].

This Code Project article could also be useful: ASP.NET authentication and authorization[^].

And after the user is authenticated, you would need to access some other site and authenticate on it. It depends on what this site requires (please see my comment to the question). Anyway, you can simulate any user's action if you use the class System.Net.HttpWebRequest:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].

Most likely, that site has some log-on form. You can learn what's required if you learn this form (say, using your browser's "View page source"). On a form, HTTP request is composed of controls with the "name" attributes. But the general problem is close to the problem of Web scraping:
http://en.wikipedia.org/wiki/Web_scraping[^].

Please see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA


这篇关于vb.net和asp新手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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