📜  如何在数据库中存储图片框位置 n 使用它 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:15.380000             🧑  作者: Mango

代码示例1
byte[] imageBt = null;
FileStream fstream = new FileStream(this.txtImage.Text, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fstream);
imageBt = br.ReadBytes((int)fstream.Length);

conn.Open();
MySqlCommand command = new MySqlCommand("insert into images(image)values(@IMG)", conn);
command.Parameters.Add(new MySqlParameter("@IMG", imageBt));

reader = command.ExecuteReader();
MessageBox.Show("Saved");

while (reader.Read())
{

}