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);
}