0

Is it possible to save some fields in the program, or do I have to write them to a file?

Example:

  1. I open a file (with OpenFileDialog) and put it in a FileInfo
  2. close the program
  3. restart the program
  4. go to open -> recent -> select the previous File

Thanks

Andrea
  • 11,801
  • 17
  • 65
  • 72
RubenHerman
  • 1,674
  • 6
  • 23
  • 42

3 Answers3

5

You can use for example the settings file to store the paths to those files(see here)

Then on startup, lookup the path in settings and create a fileinfo

RvdK
  • 19,580
  • 4
  • 64
  • 107
2

See also
How to decide where to store per-user state? Registry? AppData? Isolated Storage?

Community
  • 1
  • 1
Cheeso
  • 189,189
  • 101
  • 473
  • 713
0

you have to put it into a file somwhere... usually you use the configfile for such things. .net manages the work around this configfile very good.

Jack
  • 292
  • 1
  • 5
  • any examples? (or link to examples) – Phil Gan May 11 '10 at 10:14
  • see http://www.codeguru.com/columns/DotNet/article.php/c7987/ if you use VS you could also use the project settings to generate the configuration that is much easyier to use for the first time. – Jack May 11 '10 at 10:26