public Byte[] Tupian() 获取一张图片的字节数组
{
FileStream fs = new FileStream(@"G:\smartrt\bin\Debug\Data\tpl\111.jpg", FileMode.Open);
int filelength = 0;
filelength=(int) fs.Length; //获得文件长度
Byte[] fl = new Byte[filelength]; //建立一个字节数组
fs.Read(fl, 0, filelength); //按字节流读取
fs.Close();
return fl;
}
public static byte[] copybyte(byte[] a, byte[] b)字节数组的合并
{
byte[] c = new byte[a.Length + b.Length];
a.CopyTo(c, 0);
b.CopyTo(c, a.Length);
return c;
}
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)