消除部分warning
This commit is contained in:
@@ -505,6 +505,7 @@ public class FileHelper
|
||||
|
||||
#endregion
|
||||
|
||||
#pragma warning disable CA1416 // 验证平台兼容性
|
||||
#region 生成高清晰缩略图
|
||||
|
||||
/// <summary>
|
||||
@@ -669,6 +670,7 @@ public class FileHelper
|
||||
}
|
||||
|
||||
#endregion
|
||||
#pragma warning restore CA1416 // 验证平台兼容性
|
||||
|
||||
#region 将文件路径转为内存流
|
||||
|
||||
@@ -712,7 +714,8 @@ public class FileHelper
|
||||
|
||||
if (selectFiles.Count > 0)
|
||||
{
|
||||
return selectFiles.FirstOrDefault().FullName;
|
||||
//modified by PhilPan
|
||||
return selectFiles.First().FullName;
|
||||
}
|
||||
|
||||
return Path.Combine(folderPath, $@"{prefix}_{DateTime.Now.ParseToUnixTime()}.log");
|
||||
@@ -737,7 +740,7 @@ public class FileHelper
|
||||
Microsoft.AspNetCore.Http.HttpContext? httpContext = App.HttpContext;
|
||||
httpContext.Response.ContentType = "application/octet-stream";
|
||||
httpContext.Response.Headers.Add("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, Encoding.UTF8));
|
||||
httpContext.Response.Headers.Add("Content-Length", buff.Length.ToString());
|
||||
httpContext.Response.Headers.Add("Content-Length", buff?.Length.ToString());
|
||||
httpContext.Response.Body.WriteAsync(buff);
|
||||
httpContext.Response.Body.Flush();
|
||||
httpContext.Response.Body.Close();
|
||||
|
||||
Reference in New Issue
Block a user