I have a problem writing a program in C#.
I want to to save string variables from a ListBox1 to textfile, which is named after the item from ListBox2, like here:
Write = new StreamWriter(xxxxx);
for (int I = 0; I < ListBox1.Items.Count; I++)
{
Text = (SubCategories.Items[I]).ToString();
Write.WriteLine(Text);
}
Write.Close();
What should I replace xxxxx to have there ListBox2.SelectedItem, for example to make file "test.txt".