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,073
  • 17
  • 60
  • 64
RubenHerman
  • 1,572
  • 6
  • 20
  • 40

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,128
  • 3
  • 59
  • 105
2

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

Community
  • 1
  • 1
Cheeso
  • 184,848
  • 97
  • 460
  • 704
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
  • 294
  • 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