代码
/// <summary> /// 将文件转换成byte[] 数组 /// </summary> /// <param name="fileUrl">文件路径文件名称</param> /// <returns>byte[]</returns> public byte[] AuthGetFileData(string fileUrl) { using (FileStream fs = new FileStream(fileUrl, FileMode.Open, FileAccess.Read)) { byte[] buffur = new byte[fs.Length]; fs.Read(buffur, 0, (int)fs.Length); return buffur; } }