You have multiple option here.
Firstly you could write the value to a text file yourself using the StreamWriter class.
Another, you could looking into storing the value in an AppConfig file.
Id say the AppConfig route is probably the easiest. All you would do is create the file (see the link for doing that) then add this to the file.
<appSettings>
<add key="SomeValue" value="SomeString" />
<appSettings>
Then use this to access the value.
ConfigurationSettings.AppSettings["SomeValue"]
And this to set it
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings.Add("SomeValue", "SomeString");
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
Hope this points you in the right direction.