在asp.net中创建下载按钮 [英] to create download button in asp.net
本文介绍了在asp.net中创建下载按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
先生,我在keep dekstop上有一个文件
我想从此在我的wep页面上生成一个按钮,该文件已在Web应用程序asp.net中下载
此代码是什么?
sir a have a file on keep dekstop
i want to generate a button on my wep page from this the file is download in web application asp.net
what the code for this ?
推荐答案
尝试下面的代码
try the code below
byte[] data = File.ReadAllBytes(WDriveFilePath)
FileStream file = File.Create(HttpContext.Current.Server.MapPath(MyLocalFile));
file.Write(data, 0, data.Length);
file.Close();
More here
这篇关于在asp.net中创建下载按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文