I am writing a small application for my company. There are two text boxes and a submit button. textBox1 is where the information is entered to be write to the text file. TextBox2 is where the the user is suppose to enter the name of the file. Problem is I can't get get Textbox 2 to work. The file is created with the static name in the code but I can't figure out how to make the name it self using TextBox2. Where is my code for this section. As you can see the value entered into TextBox2 is assigned to the file name variable. I just don't know how to add static information to:
StreamWriter sw = new StreamWriter(fi lename);
StreamWriter sw = new StreamWriter(fi lename);
Code:
string filename; filename = TextBox2.Text; StreamWriter sw = new StreamWriter(filename); sw.WriteLine(textBox1.Text); sw.Flush(); sw.Close();
Comment