FileDialog

      在〈FileDialog〉中尚無留言

OpenFileDialog

Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog();
openFileDlg.DefaultExt = ".pdf";
openFileDlg.Filter = "Pdf documents (.pdf)|*.pdf";
Nullable result = openFileDlg.ShowDialog();
if (result == true)
{
    string fileName = openFileDlg.FileName;
Console.WriteLine(fileName); }

SaveFileDialog

Microsoft.Win32.SaveFileDialog saveFileDlg = new Microsoft.Win32.SaveFileDialog();
saveFileDlg.DefaultExt = ".pdf";
saveFileDlg.Filter = "Pdf documents (.pdf)|*.pdf";
Nullable result = saveFileDlg.ShowDialog();
if (result == true)
{
    string fileName = saveFileDlg.FileName;
    Console.WriteLine(fileName);
}

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *