提交当前本机整理版本
This commit is contained in:
@@ -301,4 +301,39 @@ namespace Lskj.Util
|
||||
}
|
||||
else
|
||||
{
|
||||
returnMsg
|
||||
returnMsg = "登录失败";
|
||||
isDelete = false;
|
||||
}
|
||||
return isDelete;
|
||||
}
|
||||
/// <summary>
|
||||
/// 文件转换为byte[]
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ConvertFileToBytes(string filePath)
|
||||
{
|
||||
byte[] bytContent = null;
|
||||
FileStream fs = null;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user