private static string GetWebContent(string url)
{
string strResult = "";
Uri URL = new Uri(url);
HttpWebRequest request;
HttpWebResponse WResponse;
CredentialCache myCredCache = new CredentialCache();
myCredCache.Add(URL, "Negotiate", (NetworkCredential)CredentialCache.DefaultCredentials);
// Pre-authenticate the request.
request = (HttpWebRequest)HttpWebRequest.Create(URL);
// Set the username and the password.
request.Credentials = myCredCache;
// T s property must be set to true for Kerberos authentication.
request.PreAuthenticate = true;
// Keep the connection alive.
request.UnsafeAuthenticatedConnectionSharing = true;
request.UserAgent = "Googlebot1";
request.Method = "GET";
request.Timeout = 20000;
WResponse = (HttpWebResponse)request.GetResponse();
Stream streamReceive = WResponse.GetResponseStream();
Encoding encoding = Encoding.GetEncoding("GB2312");
StreamReader streamReader = new StreamReader(streamReceive, encoding);
strResult = streamReader.ReadToEnd();
WResponse.Close();
return strResult;
}