Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Administrators
Posted

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")

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...