111,086
社区成员




byte[] tmpStr1 = System.Text.Encoding.Default.GetBytes("数据文件(略)");
string headerStr = System.Text.Encoding.Default.GetString(tmpStr1);
byte[] tmpStr2 = System.Text.Encoding.Default.GetBytes(headerStr);//在这里的byte的长度和tmpStr1 不一样了???????????
//文件流转成byte[]数组
public static byte[] FileToArrayByte(FileStream fs)
{
try
{
byte[] arrFile = new byte[fs.Length];//定义大小
int length = fs.Read(arrFile, 0, arrFile.Length); // 将文件中的数据读到arrFile数组中;
return arrFile;
}
catch (System.Exception ex)
{
return null;
}
}