Just building my first WinForms application.
Question - What's the easiest/best approach for saving some data between use of the application (e.g. list of URL with status & date/time in this case)? I don't see any need for a database.
For example * Is just storing to text file easiest? * Or is storing to XML file just as easy in DotNet * How about Windows Registry - is this something generally to avoid? Is it's use compatible across all versions including Windows 7 * Database - probably overkill here * A widely used library perhaps?
Thanks
Windows Forms (WinForms) is a UI framework for building Windows desktop applications. It is a . NET wrapper over Windows user interface libraries, such as User32 and GDI+. It also offers controls and other functionality that is unique to Windows Forms.
WPF, would be your answer to Windows Forms if you are on the . NET platform.
Winforms and Windows Forms are the same thing. Winforms is the shortened name for Windows Forms.
WinForms won't be deprecated until Win32 is ... which could be quite sometime! WPF on the other hand has few direct dependencies on Win32 so could potentially form the basis of a "fresh start" UI layer on a future version of windows.
Take a look at the Settings of your project (right-click project in Solution Explorer > Properties > Settings tab), you can define a number of variables that are persisted throughout uses of the program for each user, like username, last update time, proxy server, anything like that. The settings themselves are serialized to XML and live in the Application Settings folder for each user, but you can specify default or application-specific settings as well.
You can then use the settings like this:
MyNamespace.Properties.Settings.Default.MySetting
More info about settings files can be found @ MSDN or the Code Project
This is great if you only need to store a few variables between sessions. If you need to store a larger amount of data, look into either one of the database options suggested in the other answers, or serialization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With