Your code is refactored as:
private void btnWrite_Click(object sender, EventArgs e)
{
String filename = textbox1.Text;
TextWriter te = new StreamWriter(???);
using (StreamWriter writer = new StreamWriter(filename))
{
writer.Write("content to be written");
writer.Close();
}
}
private void btnRead_Click(object sender, EventArgs e)
{
TextReader tr = new StreamReader(???);
using (StreamReader reader = new StreamReader(filename))
{
txtRead.Text = reader.ReadLine();
reader.Close();
}
}