Hi again! I need some code on how to create a new .txt file in visual basic. Any suggestions would be great!
Printable View
Hi again! I need some code on how to create a new .txt file in visual basic. Any suggestions would be great!
Link to MSDN File class.
Here is an example of how to use the File class:-
vbnet Code:
' Public Sub CreateTextFile() Dim txtFile As String = "C:\MyTextFile.txt" System.IO.File.WriteAllText(txtFile, "This is text") End Sub