If openFileDialog_View is OpenFileDialog , then you just get a dialog box asking you to open the file. I assume that you really want to open the location in explorer.
You would do this:
if (File.Exists(filePath)) { Process.Start("explorer.exe", filePath); }
The select file explorer.exe accepts the /select argument as follows:
explorer.exe /select, <filelist>
I got this from SO message: Opening a folder in Explorer and selecting a file
So your code will look like this:
if (File.Exists(filePath)) { Process.Start("explorer.exe", "/select, " + filePath); }
gideon
source share