打开/保存文件对话框的代码 [英] code to open open/save file dilogbox
本文介绍了打开/保存文件对话框的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尊敬的先生,
我的页面上有文本框包含文件路径,当我单击该路径时,我想打开对话框,该对话框应询问打开或保存选项,就像打开电子邮件附件对话框一样.
任何链接吗?
感谢advnace
Ankita Mali
Dear sir,
I have textbox on my page contains file path ,when i click on that path, i want to open dialog box which should ask for open or save options, same like when we open email attachment dialog.
Any link ?
Thanks in advnace
Ankita Mali
推荐答案
尝试一下!可能对你有帮助.
ASP FileOpen对话框 [ http://corymathews.com/397/aspnetc-prompt -a-save-dialog-box-to-download-a-file/ [ http://aspalliance.com/259_downloading_files__forcing_the_file_download_dialog [ ^ ]
try it out! may help u.
ASP FileOpen Dialog[^]
http://corymathews.com/397/aspnetc-prompt-a-save-dialog-box-to-download-a-file/[^]
http://aspalliance.com/259_downloading_files__forcing_the_file_download_dialog[^]
在按钮单击事件上尝试以下代码:
OpenFileDialog oo = new OpenFileDialog();
DialogResult da = oo.ShowDialog();
如果(da!= DialogResult.Cancel)
{
xthup = oo.FileName;
}
MessageBox.Show(请在要存储的任何地方保存扫描图像");
SaveFileDialog saveFileDia =新的SaveFileDialog();
saveFileDia.Filter ="jpeg图片| * .jpg";
如果(saveFileDia.ShowDialog()== DialogResult.OK)
{
字符串sa = saveFileDia.FileName.ToString();
this.saveJpeg(saveFileDia.FileName,new Bitmap(this.img),85L);
}
MessageBox.Show("Done");
Try this code on button click event:
OpenFileDialog oo = new OpenFileDialog();
DialogResult da = oo.ShowDialog();
if (da != DialogResult.Cancel)
{
xthup = oo.FileName;
}
MessageBox.Show("Please save Scan Image wherever you want to store ");
SaveFileDialog saveFileDia = new SaveFileDialog();
saveFileDia.Filter = "jpeg pictures|*.jpg";
if (saveFileDia.ShowDialog() == DialogResult.OK)
{
string sa = saveFileDia.FileName.ToString();
this.saveJpeg(saveFileDia.FileName, new Bitmap(this.img), 85L);
}
MessageBox.Show("Done");
这篇关于打开/保存文件对话框的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文