The code below gives me three compiler errors. They are as follows:

1. The type or namespace name 'TextWriter' could not be found (are you missing a using directive or an assembly reference?)
2. The name 'File' does not exist in the current context
3. The name 'filename' does not exist in the current context

Can anyone provide some clarification as to why these errors are occurring, and how I can fix them?

```
private void button1_Click(object sender, EventArgs e)
{
   using (TextWriter writer = File.CreateText(filename.txt)) {
      writer.WriteLine("First name: {0}", textBox1.Text);
      writer.WriteLine("Last name: {0}", textBox2.Text);
      writer.WriteLine("Phone number: {0}", maskedTextBox1.Text);
      writer.WriteLine("Date of birth: {0}", textBox4.Text);
   } 
}

```