1
I’m used to using for Windows Phone, so:
using System.IO.IsolatedStorage;
public void putString(string key, string variable)
{
IsolatedStorageSettings iso = IsolatedStorageSettings.ApplicationSettings;
if (iso.Contains(key)) //Apenas atualiza os valores das chaves
{
iso[key] = variable;
}
else //Cria novas chaves
{
iso.Add(key, variable);
}
iso.Save();
}
public void getString(TextBox text, string save)
{
IsolatedStorageSettings iso = IsolatedStorageSettings.ApplicationSettings;
if (iso.TryGetValue<string>(text.Name, out save))
text.Text = save;
}
To write a value and take the value respectively, but in Windows Forms there is no IsolatedStorageSettings
What is the easiest method to write data in Windows Forms? It might just be String even, all I found was via file manipulation, which is more complicated.
Is there any method similar to the one I put above? Used to record a kind of dictionary, with key and value, as it would be faster and at lower cost.
What I found most interesting was using
Properties.Settings.Default
however I am not getting rs, the IDE does not let the program run with it, tells to check if it is null before saving a value, using thus:Properties.Settings.Default["key"] = "value";
– Leonardo
"the IDE does not let the program run with it, tells to check" is something very generic. Does it give an error? Give more details. Although maybe that’s a more specific problem.
– Maniero
There is no mistake is the only thing that appears
– Leonardo