|
发表于 2015-4-25 08:08:00
|
显示全部楼层
///
/// //将转成二进制数据
///
/// 文件名
///
public static Byte[] streamin(string filepath)
{
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read);
Byte[] btye2 = new byte[fs.Length];
fs.Read(btye2, 0, Convert.ToInt32(fs.Length));
fs.Close();
return btye2;
}
///
/// 将二进制数据转成
///
///
///
public static void streamout(byte[] bb, string filepath)
{
int ArraySize = bb.GetUpperBound(0);
FileStream fs = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write);
fs.Write(bb, 0, ArraySize);
fs.Close();
} |
|