C# 中 SaveFileDialog打开后如何显示默认文件名 而这个文件名是textBox1中的内容

FolderBrowserDialogfolderSaveDlg=newFolderBrowserDialog();if(folderSaveDlg.ShowDialog... FolderBrowserDialog folderSaveDlg = new FolderBrowserDialog();
if (folderSaveDlg.ShowDialog() == DialogResult.OK)
{string saveFolderPath = folderSaveDlg.SelectedPath;
string sourceFolderPath = string.Empty;
string sourceFileList = this.textBox1.Text;
if (sourceFileList.EndsWith(";"))
{ sourceFileList = sourceFileList.Substring(0, sourceFileList.Length - 1);}
string[] strArray = sourceFileList.Split(';');
if (strArray.Length > 0)
{
sourceFolderPath = System.IO.Path.GetDirectoryName(strArray[0]); // Get Source Folder Name

}
for (int i = 0; i < strArray.Length; i++)
{string destFilePath = string.Format(@"{0}\{1}", saveFolderPath, System.IO.Path.GetFileName(strArray[i]));
this.comboBoxSaveFileList.Items.Add(destFilePath);
System.IO.File.Copy(strArray[i], destFilePath); } }正确写法 多谢一楼的帮助啊!
展开
 我来答
百度网友caef6e2bb
2011-05-04 · TA获得超过2425个赞
知道小有建树答主
回答量:1174
采纳率:0%
帮助的人:1438万
展开全部
saveFileDialog.FileName = textBox1.Text;
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式