OpenFileDialog dialog = new OpenFileDialog(); if (DialogResult.OK == dialog.ShowDialog()) { string path = dialog.FileName; } code example
Example: c# open file dialog
OpenFileDialog dialog = new OpenFileDialog();
if (DialogResult.OK == dialog.ShowDialog())
{
string path = dialog.FileName;
}