James0886

Hi

i made a app that lets you login to MySQL, i whant to create a ini or config file thats saves the name and password that the user type to the textbox and when i load the app again it loads the information from the ini or config file.

how can i make that happen



thx alot in advance.


Re: Visual C# General config and ini???

czaval

I would not recommend you using an INI file.Today you have more comfortable formats to store data in for manipulating it later.

You can use the XML file for storing the username and password, so it is very easy to store and retrieve data from it.

You can you a simple 'MS Access' database file with a single table for storing user login details.

Check the option of using the cookies, but you must be ready for loosing the data in the cookies because user can in any time delete the cookies.

Anyway, remember to think about the encryption if data is sensitive.






Re: Visual C# General config and ini???

Thomas Danecker

ini-files are considered deprecated. That's also the reason why the .net framework has no support for them. It's easy to store the data in an xml file (or in the app.config) and you have rich support from the framework.

And I want to join czaval: Think about encryption if data is sensitive.






Re: Visual C# General config and ini???

boban.s

I will suggest using application settings which comes with .NET 2.0 projects. The good thing is that you access values in typed manner using properties. You can also consider storing the values in registry for security reasons.




Re: Visual C# General config and ini???

ecko007

thx alot for the replys guys, i dont mind if the user edits the file,its only to save 1 user and 1 password. can you give me a example on how to save user and password on any type of file(ini, app.config, xlm any) and load them when i open the app.and if the they type a new user name or password i whant the app to overwrite the file and load the new 1 next time.

thx in advance.




Re: Visual C# General config and ini???

Figo Fei - MSFT

Check the StreamWriter for this purpose.

Thanks