本文介绍了如何使用SaveFileDialog在Win 7中显示默认路径?我使用的是InitialDirectory,但无法实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 SaveFileDialog sfd =  SaveFileDialog();
sfd.AutoUpgradeEnabled =  false ;
                   sfd.InitialDirectory =  @"  d \ temp" ;
                   如果(sfd.ShowDialog()== DialogResult.OK)
                   {
                      //  MessageBox.Show(DialogResult.OK.ToString()); 
                       字符串 fileSavePath = sfd.FileName;


我使用的是初始目录,但可以创建它.我只想在路径"d \ temp"中显示它?
您知道,win 7与xp不同.有人知道如何更正它吗?

解决方案


SaveFileDialog sfd = new SaveFileDialog();
sfd.AutoUpgradeEnabled = false;
                   sfd.InitialDirectory = @"d\temp";
                   if (sfd.ShowDialog(this)== DialogResult.OK)
                   {
                      // MessageBox.Show(DialogResult.OK.ToString());
                       string fileSavePath = sfd.FileName;


I use initialdirectory,but can make it.I just want to show it in the path "d\temp"?
You know,win 7 is different from xp.Anybody knows how to correct it?

解决方案


这篇关于如何使用SaveFileDialog在Win 7中显示默认路径?我使用的是InitialDirectory,但无法实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 05:24