How should I store per-user data in WinForms?

前端 未结 6 1368
無奈伤痛
無奈伤痛 2020-12-16 06:01

In my WinForms app, I have a few textboxes that the user typed some data into. I want to store the data, but I don\'t want to use a database. In my stone-age C++ days, I\'

6条回答
  •  失恋的感觉
    2020-12-16 06:38

    Create a .config or other data file (e.g. xml) in the application data for the specific user.

    use system.environment.specialfolder to get the ApplicationData folder, add a subfolder with your company name, within this a subfolder with your application name, within this your data file for this specific user. Thus,

    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\YourCompany\\YourApplication\\YourData.config"
    

提交回复
热议问题