W
WolfgangD
Hi,
I have got a prblem:
I created a checkbox, this checkbox will get the informations from a
text file :
FileStream mem_name = new FileStream(pfad, FileMode.Open,
FileAccess.Read);
StreamReader read_name = new
StreamReader(mem_name);
string row;
while ((row= read_name.ReadLine()) != null)
{
comboBox1.Items.Add(row);
}
That works!
Now ,
if I select a value I want that this value will be saved......so that
this value is selected at the next program start.
I was trying to to this with an second file:
//SELECTED VALUE IN COMBOOX
string defname = comboBox1.Text;
//path for txt file
string defpath = Application.StartupPath + "\\defserver.txt"
//create file
FileStream fs = new FileStream(defpfad, FileMode.CreateNew);
StreamWriter myStreamWriter = new StreamWriter(fs);
//put the calue inside the textfile
myStreamWriter.WriteLine(defname);
myStreamWriter.Close();
Is this okay ? How can I go on ?
Thanks!!!
Wolfgang
I have got a prblem:
I created a checkbox, this checkbox will get the informations from a
text file :
FileStream mem_name = new FileStream(pfad, FileMode.Open,
FileAccess.Read);
StreamReader read_name = new
StreamReader(mem_name);
string row;
while ((row= read_name.ReadLine()) != null)
{
comboBox1.Items.Add(row);
}
That works!
Now ,
if I select a value I want that this value will be saved......so that
this value is selected at the next program start.
I was trying to to this with an second file:
//SELECTED VALUE IN COMBOOX
string defname = comboBox1.Text;
//path for txt file
string defpath = Application.StartupPath + "\\defserver.txt"
//create file
FileStream fs = new FileStream(defpfad, FileMode.CreateNew);
StreamWriter myStreamWriter = new StreamWriter(fs);
//put the calue inside the textfile
myStreamWriter.WriteLine(defname);
myStreamWriter.Close();
Is this okay ? How can I go on ?
Thanks!!!
Wolfgang