username & password with webclient??

vbharry
05-08-2004, 05:12 PM
I am using the webclient method to download data from a web site:

Dim wc As New Net.WebClient()
Dim strData As String
Dim stream As IO.StreamReader
Dim strURL As String

strURL = "http://www.cnn.com"
stream = New IO.StreamReader(wc.OpenRead(strURL))
strData = stream.ReadToEnd

This works fine for a regular web page, but now I want to download data from a web page that requires you to login first (user name & password). I can't figure out how to incorporate the user name & password into the webclient code above. Any ideas? Perhaps I need to use a method other than webclient? I know that in VB6 you could use the username & password with the inet control, but I can't figure out how to do it in .Net.

Thanks for the help!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum