打开文件:
Microsoft.Win32.OpenFileDialog open = new Microsoft.Win32.OpenFileDialog(); open.Multiselect = false; open.Filter = "表格(*.CSV)|*.CSV"; Nullable<bool> flag = open.ShowDialog(); if (flag == true) { string filename = open.FileName; }
保存文件:
Microsoft.Win32.SaveFileDialog save = new Microsoft.Win32.SaveFileDialog(); save.Filter = "表格(*.CSV)|*.CSV"; Nullable<bool> flag = save.ShowDialog(); if (flag == true) { string filename = save.FileName; }