Dim FileName As String
SaveFileDialog1.InitialDirectory = "C:\"
SaveFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件|*.*"
SaveFileDialog1.RestoreDirectory = True
SaveFileDialog1.FilterIndex = 1
SaveFileDialog1.Title = "保存记录文档"
SaveFileDialog1.AddExtension() = True
SaveFileDialog1.CheckPathExists() = True
SaveFileDialog1.ValidateNames() = True
SaveFileDialog1.ShowHelp() = True
SaveFileDialog1.OverwritePrompt() = True
SaveFileDialog1.ShowDialog()
FileName = SaveFileDialog1.FileName
(FileName.ToString, TextBox1.Text, False, System.Text.Encoding.Default)