Hi,
I am trying to create a textfile and write some lines into the textfile. However, the code that i am using can only write when the textfile is already created in the directory.
For this case, can i actually allow my script to search if a textfile is being created, if not create a textfile ???
Thanks
I am trying to create a textfile and write some lines into the textfile. However, the code that i am using can only write when the textfile is already created in the directory.
For this case, can i actually allow my script to search if a textfile is being created, if not create a textfile ???
VB.NET:
Dim pathdir As String = "C:\workingdir\test.txt"
If System.IO.File.Exists(pathdir) = True Then
Dim objWriter As New StreamWriter(pathdir)
objWriter.Write("This is a test file!!!")
objWriter.Close()
MsgBox("Text written to file")
Else
MsgBox("File Does Not Exist")
End If
Thanks