diff --git a/插件库/Lskj.PubBomImport/FrmProgress.cs b/插件库/Lskj.PubBomImport/FrmProgress.cs index a592653..6303c02 100644 --- a/插件库/Lskj.PubBomImport/FrmProgress.cs +++ b/插件库/Lskj.PubBomImport/FrmProgress.cs @@ -34,6 +34,7 @@ using Newtonsoft.Json; using Lskj.Business.Impl; using System.Text.RegularExpressions; using Lskj.Util; +using System.Web; namespace Lskj.PubBomImport { @@ -1193,4 +1194,38 @@ namespace Lskj.PubBomImport { returnMsg = ex.Message; isUpload = false; - \ No newline at end of file + } + msg = returnMsg; + return isUpload; + } + /// + /// 附件转换byte[] + /// + /// 附件路径 + /// 二进制 + private byte[] ConvertFileToBytes(string filePath) + { + byte[] bytContent = null; + System.IO.FileStream fs = null; + System.IO.BinaryReader br = null; + try + { + fs = new FileStream(filePath, System.IO.FileMode.Open); + } + catch (Exception) + { + throw; + } + finally + { + if (fs != null) + br = new BinaryReader((Stream)fs); + if (br != null) + bytContent = br.ReadBytes((Int32)fs.Length); + if (fs != null) + fs.Dispose(); + } + return bytContent; + } + } +}