title: save button does not save in .txt file Visual Basic .NET
body: <pre><code>Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
      Dim strLineFromSave As String
                'This method below returns a String of 81 characters long.'
      strLineFromSave = grid.udsSave()
      SaveFileDialog1.Filter = "TXT Files (*.txt*)|*.txt*"
      If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
          Dim sw As System.IO.StreamWriter = New System.IO.StreamWriter(SaveFileDialog1.FileName)
              'For loop to write a line every 9 characters, so you get a 9x9 grid.'
          For intCounter As Integer = 0 To (strLineFromSave.Length - 1) Step 9
              Dim strTemp = strLineFromSave.Substring(intCounter, 9)
              sw.WriteLine(strTemp)
          Next
          sw.Close()
      End If
  End Sub
  </code></pre>
  
  <p>The code above is made to save my Sudoku game into a .txt file.</p>
  
  <p>Problem I have is that whenever I click the save button, everything works, up until the point that it didn't save the file as a .txt file. It just saved it as a 'file'.</p>
  
  <p>Does anybody understand where this comes from? And how do I fix this?</p>
  
  <p><strong><em>NOTE:</em></strong> <strong>I have tried setting the SaveFileDialog1.filter to txt files only, this did not help.</strong></p>
  
  <p>Thanks in advance.</p>