Commit d622af05 authored by 黄奎's avatar 黄奎

下载优化

parent 669cc6a7
......@@ -2403,10 +2403,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
int lastSlashIndex = path.LastIndexOf('/');
string fileName = path.Substring(lastSlashIndex + 1);
string newFilePath = savePath + fileName;
string logStr = string.Format("{0} 开始下载 Url_{1} 文件 ", DateTime.Now.ToString("MM-dd HH:mm:ss fff"), url);
Console.WriteLine(logStr);
LogHelper.WriteInfo(logStr);
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
......@@ -2421,12 +2418,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
catch (Exception ex)
{
logStr = string.Format("{0} 下载 Url_{1} 异常:{2} message:{3}", DateTime.Now.ToString("MM-dd HH:mm:ss fff"), url, ex.StackTrace, ex.Message);
Console.WriteLine(logStr);
LogHelper.WriteInfo(logStr);
}
logStr = string.Format("{0} 下载 Url_{1} 文件结束 ", DateTime.Now.ToString("MM-dd HH:mm:ss fff"), url);
Console.WriteLine(logStr);
LogHelper.WriteInfo(logStr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment