Tuesday, August 19, 2008

HOW TO CREATE AND WRITE A FILE IN VB.NET

Dim FILE_NAME As String = "C:\file2.txt"

If System.IO.File.Exists(FILE_NAME) = True Then

Dim fs As New FileStream(FILE_NAME, FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("Congrates you have created a new file")
s.Close()

ElseIf System.IO.File.Exists(FILE_NAME) = False Then

Dim fs As New System.IO.FileStream(FILE_NAME, FileMode.Create, FileAccess.Write)
Dim s As New System.IO.StreamWriter(fs)
s.WriteLine("Congrates you have created a new file")
s.Close()

End If

No comments:

Docker Tutorial

 I have listed all the necessary commands of Docker below. In case if any is missing or if any improvement required, please share in comment...