A text (txt files) file is a file containing an encoded string which is split into lines The most common encoding for these files is ASCII because it contains all the characters we need and is relatively compact. The reason you may use other encoding ciphers is if you need accents or other special characters.
A simple .txt file is called a sequential file.
Visual basic has a built in function you can use to read and write to text files
System.IO.StreamReader()
A stream reader is a buffering mechanism for the string output. It reads the binary as an ASCII string and loads the characters one by one in to a buffer array and saves itself in RAM to be manipulated.
Here is an example of starting a StreamReader instance
Dim FILE_NAME As string "/home/jstone/{{.ENCYPT_MOUNT.}}//Desktop/test.txt"
Dim objReader As New System.IO.StreamReader(FILE_NAME)
TextBox.Text = objReader.ReadToEnd
objReader.Close()
In most cases however you will need to verify that the file exists use
If System.IO.File.Exists(FILE_NAME) Than
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter('test.txt')
objWriter.Write(TextBox1.Text)
objWriter.Close()
End If
If you need to clone a file in a different location e.g backup
System.IO.File.Copy('SecretPasswords.txt', '/media/Evil_USB/mwahahah.txt')
System.IO.File.Move('Dodgy Browser history.txt', '~/.trash/dodgy.txt')
System.IO.File.Delete('~/.trash/dodgy.txt')