When searching a file in Windows Explorer and right-click a file from the search results; there is an option: "Open file location". I want to implement the same in my C# WinForm. I did this:
if (File.Exists(filePath)
{
openFileDialog1.InitialDirectory = new FileInfo(filePath).DirectoryName;
openFileDialog1.ShowDialog();
}
Is there any better way to do it?
openFileDialog_View
is an OpenFileDialog then you'll just get a dialog prompting a user to open a file. – Athanasius