如何在用户控件中创建“保存文件”对话框?

时间:2021-03-17 15:50:49

I want to open a file dialog box in user control. I used using System.Windows.Forms, but still I can't access SaveFileDialog class. Can anybody tell me how to do this? Thanks.

我想在用户控件中打开一个文件对话框。我使用过System.Windows.Forms,但仍然无法访问SaveFileDialog类。谁能告诉我怎么做?谢谢。

3 个解决方案

#1


2  

You cannot use SaveFileDialog in asp.net (if I look at the tags of the question).

您不能在asp.net中使用SaveFileDialog(如果我查看问题的标签)。

It seems you want to let the uset click on some button to download a file and prompt the user to save it.

看来你想让uset点击某个按钮来下载文件并提示用户保存它。

If that is a correct assumption, see the accepted answer at with just a plain html and js file, how can i force a link to an mp3 to download instead of just play?

如果这是一个正确的假设,只需一个简单的html和js文件,看到接受的答案,我如何强制链接到MP3下载而不是只是播放?

#2


0  

<input type=file> 

or

<asp:FileUpLoad id="FileUpLoad1" runat="server" />

might be what you have in mind. It will let the user upload a file as part of the POST.

可能是你的想法。它将让用户上传文件作为POST的一部分。

#3


0  

Thanks for your reply. I found solution for this and its working. I used HTTPHandler to download file on cliet side.

感谢您的回复。我找到了解决方案及其工作原理。我使用HTTPHandler在cliet端下载文件。

#1


2  

You cannot use SaveFileDialog in asp.net (if I look at the tags of the question).

您不能在asp.net中使用SaveFileDialog(如果我查看问题的标签)。

It seems you want to let the uset click on some button to download a file and prompt the user to save it.

看来你想让uset点击某个按钮来下载文件并提示用户保存它。

If that is a correct assumption, see the accepted answer at with just a plain html and js file, how can i force a link to an mp3 to download instead of just play?

如果这是一个正确的假设,只需一个简单的html和js文件,看到接受的答案,我如何强制链接到MP3下载而不是只是播放?

#2


0  

<input type=file> 

or

<asp:FileUpLoad id="FileUpLoad1" runat="server" />

might be what you have in mind. It will let the user upload a file as part of the POST.

可能是你的想法。它将让用户上传文件作为POST的一部分。

#3


0  

Thanks for your reply. I found solution for this and its working. I used HTTPHandler to download file on cliet side.

感谢您的回复。我找到了解决方案及其工作原理。我使用HTTPHandler在cliet端下载文件。