如何使用C#从文件夹下载文件 [英] How to download a file from folder using c#

查看:106
本文介绍了如何使用C#从文件夹下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

我正在.net framework 2.0和c#中开发项目.我正在c://Reports中存储文件,现在如果用户单击按钮,我想下载该文件.我想显示一个打开/保存对话框,以便用户可以将文件保存在任意位置.

请给我建议一些代码片段或参考链接.

在此先感谢.

致以问候
Shashi.

Hi friends

I am developing my project in .net framework 2.0 and c#.I am storing files in c://Reports and now I want to download the file if user clicks on the button.I want to show a open/save dialog box so that user can save the file where ever he wants.

Please suggest me some code snippets or reference links.

Thanks in Advance.

With Regards
Shashi.

推荐答案

要显示打开现有文件的对话框,请使用 ^ ].
要显示一个对话框来保存文件,请使用 SaveFileDialog [ ^ ].
To show a dialog box to open existing files use OpenFileDialog[^].
To show a dialog box to save a file use SaveFileDialog[^].


下载"是什么意思?文件在服务器上吗?该项目是网站吗?
What do you mean by ''download'' ? Is the file on a server ? Is the project a web site ?


Silverlight 3.0添加了 OpenFileDialog
Silverlight 3.0 Added the SaveFileDialog.

And there was always the OpenFileDialog


这篇关于如何使用C#从文件夹下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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