HelpImNewbie Posted April 11, 2006 Posted April 11, 2006 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 I've 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? I've 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 Quote
Administrators PlausiblyDamp Posted April 11, 2006 Administrators Posted April 11, 2006 Not had chance to test this but have you tried setting the credentials for the WebClient? Dim wc As New System.Net.WebClient wc.Credentials = new NetworkCredential("username","password") wc.DownloadFile("http://www.site.com/file.php", "C:\test.xml") Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
HelpImNewbie Posted April 12, 2006 Author Posted April 12, 2006 Thank you for the response but unffortunately I can't login 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 I'll try to put a webbrowser (what is its name in .NET?). Thank you very much :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.