public static bool HttpDownloadFile(string downloadUrl, string localPath, log4net.ILog log)
{
bool bFlagDownloadFile = false;
//log.Debug("HttpDownloadFile--准备以HTTP的方式下载文件,url:[" + downloadUrl + "]本地文件:【" + localPath + "】");
HttpWebRequest request = null;
HttpWebResponse resp = null;
try
{
request = WebRequest.Create(downloadUrl) as HttpWebRequest;
request.Timeout = 3000;
//log.Info("HttpDownloadFile--新建HttpWebRequest!");
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(delegate { return true; });
resp = request.GetResponse() as HttpWebResponse;
string responseCode = string.Empty;
//获得http响

最低0.47元/天 解锁文章
932

被折叠的 条评论
为什么被折叠?



