0
我基本上只是想獲得一個文件路徑來保存文件,但我的SaveFileObject不會讓我訪問SelectedPath。我檢查了其他論壇,無法弄清楚爲什麼它贏得了'tlet我,這是我的代碼;在C#Winforms中使用SaveFileDialog
SaveFileDialog filePath = new SaveFileDialog();
DialogResult result = filePath.ShowDialog();
if (result == DialogResult.OK)
{
string folderPath = filePath.;
}
它會讓我再次選擇filePath.ShowDialog和filePath.ToString等...我哪裏錯了?
你是說這不會讓你做folderPath = filePath.FileName; – dazedandconfused
當你發現你的猜測是錯誤的,並且選擇不閱讀文檔以找出該屬性的名稱時,你出錯了。 –
它不會讓我寫「string folderPath = filePath.SelectedPath」來獲取用戶選擇的文件路徑後filePath.ShowDialog() –