proxy authentication failed 407 error

G

Guest

try
{
WebRequest req = WebRequest.Create(@"http://www.google.com");
req.Method = "GET";
WebProxy p = new WebProxy(@"http://ganymede:8090", false);
p.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;
req.Proxy = p;
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse res=req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
while (sr.ReadLine() != null)
{
Console.Write(sr.ReadLine());
}
}

catch (Exception e)
{
Console.WriteLine(e.Message);
Console.Read();
}
Console.Read();
}

i use a proxy server. so to acees the web content i set the proxy property
of request object.while running tha above code i get a error the request was
aborted/cancelled-invalid length for base 64 array.
if i comment this lin p.Credentials =
CredentialCache.DefaultCredentials;then i get a error proxy authentication
required 407. any help will be appreciated.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top