Hard coding a path is rarely the best of ideas.
What you can do is that you use the file dialog the first time, and then you save the path in the application settings.
Then your app can check if a stored path exists and that it is a valid path.
If not, you open the file dialog again.
See
Application Settings Overview[
^]
and
Using Settings in C#[
^]
The code could be something like this:
if (string.IsNullOrEmpty(Properties.Settings.Default.MyStoredFilePath)
|| !File.Exist(Properties.Settings.Default.MyStoredFilePath))
{
if (fileDialog.ShowDialog() == DialogResults.OK)
Properties.Settings.Default.MyStoredFilePath = fileDialog.FileName;
}
if (File.Exist(Properties.Settings.Default.MyStoredFilePath))
OpenDocumentOrWhatEverYourMethodIs(Properties.Settings.Default.MyStoredFilePath);
else