-2

I m trying to run new application in my application like new open. I use:

Process.Start(@"filelocation");

It is OK but when the user changes the file location, how can I make it found.

Shaharyar
  • 12,254
  • 4
  • 46
  • 66

2 Answers2

1

You have three options:

  1. Have a configuration file where the user can specify the location of the executable.
  2. Inform the user that the file no longer exists where you expected it to be and do (1) and store the location.
  3. Do (2) but do a search for the executable, prioritising expected locations - and let the user choose the right location, then store it ala (2) and (1).
Moo-Juice
  • 38,257
  • 10
  • 78
  • 128
0

capture the file location in an xml file, or a config file.

read the location from the file.

when the user changes the location, they need to make sure that the location data is updated in the config file.

Alternatively, the user can enter the complete path as a parameter.

Kiran
  • 1