How would I add a new line to the textfile, instead of erasing everything I currently have
here is my current code
Feel free to fix up the code also if you want, because I know it's messy
here is my current code
Dim inputData As String
inputData = InputBox("Enter what to save")
Dim FILE_NAME As String = "C:\Users\Ben\Documents\Vb.netshiz\learninggoal.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.WriteLine(vbNewLine & inputData)
objWriter.Close()
MsgBox("Text written to file")
Else
MsgBox("File Does Not Exist, being created now")
Dim writeFile As IO.StreamWriter
writeFile = IO.File.CreateText(FILE_NAME) 'Creates a new file
writeFile.WriteLine(inputData)
writeFile.Close()
End If
Feel free to fix up the code also if you want, because I know it's messy