The following can be used for proxy detection:
HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create("http://www.google.com");
WebProxy p = (WebProxy) WebRequest.DefaultWebProxy;
if (proxy.Address.AbsoluteUri != string.Empty)
{
httpWReq.Proxy = proxy;
}
else
{
ICredentials cred;
cred = new NetworkCredential("student", "student");
p = new WebProxy("http://10.10.16.1:3434/", true, null, cred);
httpWReq.Proxy = p;
}
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "username=student";
postData += "&password=student";