fix:升级

This commit is contained in:
geh
2025-06-19 19:23:01 +08:00
parent 0cb37e2c02
commit 7aa8baadbb
111 changed files with 14465 additions and 1480 deletions
+59
View File
@@ -462,5 +462,64 @@ namespace BLL
return result;
}
/// <summary>
/// 获取附件数据流类 多附件的情况
/// </summary>
/// <param name="attachUrl">附件路径</param>
/// <returns></returns>
public static List<byte[]> GetMoreFileStructByAttachUrl(string attachUrl)
{
List<byte[]> fileContext = new List<byte[]>();
try
{
if (!String.IsNullOrEmpty(attachUrl))
{
string physicalpath = ConfigurationManager.AppSettings["localRoot"];
string filePath = string.Empty;
string[] strs = attachUrl.Trim().Split(',');
foreach (var item in strs)
{
//HttpContext.Current.Request.PhysicalApplicationPath;
filePath = physicalpath + item;
if (File.Exists(filePath))
{
fileContext.Add(fileConvertByte(item));
}
}
}
}
catch (Exception ex)
{
string a = ex.Message;
}
return fileContext;
}
#region ()
/// <summary>
/// 附件转换二进制数据(用于保存数据库)
/// </summary>
/// <param name="filePath">附件路径</param>
/// <returns>二进制</returns>
public static byte[] fileConvertByte(string filePath)
{
string physicalpath = (ConfigurationManager.AppSettings["localRoot"] + "\\" + filePath).Replace("\\\\", "\\");
byte[] bytContent = null;
System.IO.FileStream fs = null;
System.IO.BinaryReader br = null;
try
{
fs = new FileStream(physicalpath, System.IO.FileMode.Open);
}
catch
{
}
br = new BinaryReader((Stream)fs);
bytContent = br.ReadBytes((Int32)fs.Length);
fs.Dispose();
return bytContent;
}
#endregion
}
}