我正在使用基于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()
答案 0 :(得分:0)
知道了。 File.WriteAllBytes(Path和; FileName,WebCtrl.GetDs(“FileImage”))