407 Proxy authentication required?

Discussion in 'ASP .Net' started by Ily, Oct 31, 2005.

  1. Ily

    Ily Guest

    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"
    Ily, Oct 31, 2005
    #1
    1. Advertising

  2. See : http://support.microsoft.com/default.aspx?scid=kb;en-us;248020

    Also, verify your syntax against this example :
    http://msdn.microsoft.com/library/d...l/frlrfSystemNetWebRequestClassProxyTopic.asp



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en EspaƱol : http://asp.net.do/foros/
    ======================================
    "Ily" <> wrote in message
    news:...
    > 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"
    >
    Juan T. Llibre, Oct 31, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c3VqaXRo?=

    proxy authentication failed 407 error

    =?Utf-8?B?c3VqaXRo?=, Jun 10, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    399
    =?Utf-8?B?c3VqaXRo?=
    Jun 10, 2007
  2. Scott O'Donnell

    request failed with HTTP status 407: Proxy Authentication Required

    Scott O'Donnell, Feb 14, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    623
    Scott O'Donnell
    Feb 14, 2005
  3. UJ

    Proxy Authentication Required - Error 407

    UJ, Aug 15, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    367
  4. Sau

    HTTP Status 407: Proxy Authentication Required

    Sau, Apr 9, 2009, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    2,651
  5. Replies:
    1
    Views:
    807
Loading...

Share This Page