407 Proxy authentication required?

I

Ily

Hi

I have the following code:


Dim cred1 As New System.Net.NetworkCredential("myusername",
"mypassword", "mydomainname")
Dim cc As New System.Net.CredentialCache
cc.Add(New Uri("http://www.yahoo.com"), "Basic", cred1)
Dim wp As System.Net.WebProxy = New
System.Net.WebProxy("myproxy", 80)
wp.Credentials = cc

Dim wr As WebRequest = WebRequest.CreateDefault(New
Uri("http://www.yahoo.com"))
wr.Proxy = wp
Dim wrep As WebResponse = wr.GetResponse()

Dim st As MemoryStream = wrep.GetResponseStream()
Dim sr As StreamReader = New StreamReader(st)
Dim result As String = sr.ReadToEnd()
Response.Write(result)
Response.End()
End Sub

When I execute the above code I get the error "The remote server
returned an error: (407) Proxy Authentication Required"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top