摘要:
1.将Image图像文件存入到数据库中我们知道数据库里的Image类型的数据是"二进制数据",因此必须将图像文件转换成字节数组才能存入数据库中. //将本地图片转换成二进制保存起来 private byte[] SetImageToByteArray(string fileName) { FileStream fs = null; try { fs = new FileStream(fileName, FileMode.Open, System.IO.Fil... 阅读全文
摘要:
private void button1_Click(object sender, EventArgs e) { var openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Image Files | *.JPG"; openFileDialog.RestoreDirectory = true; openFileDialog.FilterIndex = 1; if (openFileDialog.... 阅读全文