我正在使用基于 vb.net 的窗口,我想在我的 SQL 服务器中获取或下载 FileImage。在 ASP.NET 中,我可以通过此代码下载它。但我想把它翻译成基于 windows 的。你能帮帮我吗?
谢谢,
Dim oFileType As String = oPortal.GetDs("FileType")
Dim oFile As Byte() = oPortal.GetDs("FileImage")
Dim oRecordKey As String = oPortal.GetDs("FileName")
Response.ContentType = "image/" & oFileType
If Request.QueryString("open") <> "" Then
Response.AppendHeader("Content-Disposition", "attachment; filename=" & oRecordKey)
End If
Response.BinaryWrite(oFile)
Response.End()
最佳答案
明白了。 File.WriteAllBytes(oPath & oFileName, WebCtrl.GetDs("FileImage"))
关于sql - 从 SQL Server 下载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16207173/