I would like to create the txt file that has name from my textbox1 and at the same time, I would like to write in it text from my textbox2.
Can you help me?
I have tried this
private void button1_Click(object sender, EventArgs e)
{
string path = @"C:\Users\felc\Desktop\file\" + textBox1.Text +
".txt";
File.Create(path);
using (var tw = new StreamWriter(path, true))
{
tw.WriteLine(textBox1.Text);
}
}