One of the best ways to store values and restore them back is Application Configuration File, it is an XML file that you can add from add new element menu , we will se how to take back a value stored in that useful file in this tut so let's start :
1. Add a configuration file to your application:
In the solution explorer Wright click on the solution, choose add-> new Element

From the shown window choose
configuration file

Click OK and leave the name as it is .
2. Add a value to the config file
Add the appSettings section and the key and the value like this
<?xml version="1.0" encoding="utf-8" ?>
<configuration><appSettings>
<add key="Mykey " value=" MyValue " />
</appSettings>
</configuration>
My Value is the string value we stored in the config file and we will call it later by its key Mykey

Join the conversation! Your thoughts help the community grow.