日期:2014-05-17 浏览次数:20480 次
static void Main(string[] args)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("https://121.199.16.229:8890/generate.cgi?rbid=1001&esn=22021434025005&pic=png&count=1&pix=250&cor=lo&comm=%E6%B5%A6%E6%B1%9F%E6%B8%B8%E8%A7%881%E5%8F%B7%E9%BE%99%E8%88%B9%2F%E5%B7%A5%E8%A1%8C%E5%8F%B7%EF%BC%8C2013%E5%B9%B46%E6%9C%881%E5%8F%B7%EF%BD%9E2013%E5%B9%B46%E6%9C%8831%E5%8F%B7%EF%BC%8C14%3A00");
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);//验证服务器证书回调自动验证
WebResponse webResponse = webRequest.GetResponse();
Console.WriteLine(webResponse.ResponseUri.AbsoluteUri);//输出https://121.199.16.229:8890/cgi/1001363993292848.png
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{ // 总是接受
return true;
}