I have a reg text box and just want to add the save command, I managed to figure out how to do open but save is giving me problems. I am fairly new at VB.net been coding less then a week so I need all the help you can give me. Thank you in advance and here is the code I got so far:
Dim SaveFileName As String Dim DidWork As Integer = SaveFileDialog1.ShowDialog() SaveFileName = SaveFileDialog1.FileName() SaveFileDialog1.Filter = "Text Files|*.txt" SaveFileDialog1.OverwritePrompt = True System.IO.File.Create(SaveFileName) Dim objWriter As New System.IO.StreamWriter(SaveFileName) objWriter.Write(TextBox1.Text) objWriter.Close() MsgBox("Text Written to file")
I am not sure what I am missing or if I am even on the right track.