I beleive the best ways of “variable short term” persistance in an ASP.NET application are:
- Sessions Variable (Session Scope)
- Application Variable (Application Scope)
- Page View (Page Scope)
- Application Settings (Application Scope)
- ???
What are the best ways of “variable short term” persistance in a windows form application for:
- Form Scope
- User Session Scope
- Application Global Scope
Thanks
Right-click the project, select properties->Settings. You can edit persistent fields (i.e. settings), specifying name, type and scope (user-wide or application-wide).
You can access them from the code by <Default Namespace>.Properties.Settings.Default.
The settings are persistent between application runs.
You should use these settings for the Form Scope too.
All these settings make sense for storing persistent values between application runs. Use regular (static) fields for storing data within one program instance.