我尝试从表中加载CODE
并用作最终 jpg 的名称...但我不知道如何为每个图像使用他的名称和代码...您有想法吗?NAME_IMAGE
IMAGES
SqlConnection connection = new SqlConnection("*****");
connection.Open();
SqlCommand command = new SqlCommand("SELECT IMAGE,NAME_IMAGE,CODE FROM IMAGES", connection);
byte[] buffer = (byte[]) command.ExecuteScalar ();
connection.Close();
FileStream fs = new FileStream(@"C:\Users\L\Desktop\\" + (CODE) + "_" + (NAME_IMAGE) + ".jpg", FileMode.Create);
fs.Write(buffer, 0, buffer.Length);
fs.Close();