0

我有一个客户要求能够从 Sql Server Db 中检索图像并转身并将其保存到他计算机上的目录中。他希望能够通过 asp.net 网页做到这一点。我能够从图像中检索图像作为字节数组,但不知道如何获取该图像并将其作为文件保存到目录中。有人对如何做到这一点有任何想法吗?谢谢。

4

1 回答 1

1

你可以试试Save Method

    MemoryStream memoryStream = new MemoryStream((byte[])YourDataTable.Rows[0]["ImageData"]);
    Picturebox picturebox = new Picturebox();
    picturebox.Image = Image.FromStream(memoryStream);
    picturebox.Image.Save("...YourPath", System.Drawing.Imaging.ImageFormat.Jpeg)
于 2012-09-27T17:13:58.700 回答