gpt4 book ai didi

sql - 从 SQL Server 下载图像

转载 作者:行者123 更新时间:2023-12-04 23:45:34 24 4
gpt4 key购买 nike

我正在使用基于 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com