Login in a web site (never answered this)

HelpImNewbie

New member
Joined
Apr 11, 2006
Messages
2
Hi, this is my first post, and hope I dont have to post many more ;)

When i ve reached this forum what i want was: Open a website, login into, download a file

Ive looked in 27 pages of networking :p forum and now I can: Open a website and download a file, so...

How can I login into a website?

Ive see some people suggest to do: http://www.site.com/login.php?username=strUser&password=strPass

But it doesnt work in the web I want to login (neither user:pass@www.site.com)

I dont know if there is a way to do this with this:

Dim wc As New System.Net.WebClient
wc.DownloadFile("http://www.site.com/file.php", "C:\test.xml")

Thank you
 
Not had chance to test this but have you tried setting the credentials for the WebClient?

Code:
Dim wc As New System.Net.WebClient
wc.Credentials = new NetworkCredential("username","password")
wc.DownloadFile("http://www.site.com/file.php", "C:\test.xml")
 
Thank you for the response but unffortunately I cant login

Code:
Dim wc As New System.Net.WebClient
wc.Credentials = new System.Net.NetworkCredential("username","password")
I dont have to put the login page here?
wc.DownloadFile("http://www.site.com/file.php", "C:\test.xml")

When I try this I have an XML...with the source code of the login page, I used to login and download the file in VB6 with a invisible webbrowser control (but i dont like) If there no more option Ill try to put a webbrowser (what is its name in .NET?).

Thank you very much :)
 
Back
Top