如何将图片以二进制的形式存入数据库中
在二进制的形式读取出来
求代码
public byte[] ImageConvertToByte(string filepath)
{
//filepath = @"E:/e.jpg";
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read);//例如读取E盘e.jpg转换为数据流
Byte[] btye2 = new byte[fs.Length];
fs.Read(btye2, 0, Convert.ToInt32(fs.Length));
fs.Close();
return btye2;
}