title: StreamWriter leaving a file even if not saved
body: <p>I have this code to write some data from textboxes into a textfile. And i'm using streamwriter to do this. Here you may see the code below:</p>
  
  <pre><code>Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
          Dim Save As New SaveFileDialog()
          Dim myStreamWriter As System.IO.StreamWriter
          Save.Filter = "Text [*.txt*]|*.txt|All Files [*.*]|*.*"
          Save.CheckPathExists = True
          Save.Title = "Export &amp; Save - FNG"
          Save.FileName = txtTitle.Text &amp; " - Plugs Details File Exported"
          Save.ShowDialog(Me)
          Try
  
              myStreamWriter = System.IO.File.AppendText(Save.FileName)
              myStreamWriter.Write("Details of Plugs:" &amp; Environment.NewLine &amp; txtDetails.Text &amp; Environment.NewLine &amp; DateAndTime.Now)
              myStreamWriter.Flush()
          Catch ex As Exception
          End Try
  
  
      End Sub
  </code></pre>
  
  <p>The code does work fine, it saves the details into a text file too. But the problem is when i cancel the save file dialog (without saving the textfile) it stil creates a file in the application start path. Why is this happening? What am i doing wrong? How do i correct this?</p>