C#實現【選擇文件夾的保存路徑】
private static string OpenFolderAndSelectFile()
{
string FolderPath = null;
FolderBrowserDialog FbDialog = new FolderBrowserDialog();
DialogResult result = FbDialog.ShowDialog();
if (result == DialogResult.OK)
{
FolderPath = FbDialog.SelectedPath;
}
return FolderPath;
}
C#實現【選擇mdb文件的保存路徑】
public static string WsPath()
{
string WsFileName = "";
OpenFileDialog OpenFile = new OpenFileDialog();
OpenFile.Filter = "個人數據庫(MDB)|*.mdb";
DialogResult DialogR = OpenFile.ShowDialog();
if (DialogR == DialogResult.Cancel)
{
}
else
{
WsFileName = OpenFile.FileName;
}
return WsFileName;
}