我如何将此代码更改为桌面应用程序 [英] how i change this code to desktop appliction

查看:146
本文介绍了我如何将此代码更改为桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Protected Sub download(ByVal dt As DataTable)
  Dim bytes() As Byte = CType(dt.Rows(0)("Data"), Byte())
  Response.Buffer = True
  Response.Charset = ""
  Response.Cache.SetCacheability(HttpCacheability.NoCache)
  Response.ContentType = dt.Rows(0)("ContentType").ToString()
  Response.AddHeader("content-disposition", "attachment;filename="
  & dt.Rows(0)("Name").ToString())
  Response.BinaryWrite(bytes)
  Response.Flush()
  Response.End()
End Sub

推荐答案

您不需要 - 对于桌面应用程序,该文件已经在系统上,无需从任何地方下载以将其传输到用户HDD上。
You don't need to - for a desktop app the file is already on the system and doesn't need to be downloaded from anywhere to get it onto the users HDD.


这篇关于我如何将此代码更改为桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆