我使用基于 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()