VB.net Program to Write Data Into a Text File

You are currently viewing VB.net Program to Write Data Into a Text File

VB.Net program to write data into a text file

'VB.Net program to write text into a file.

Imports System.IO

Module Module1
    Sub Main()
        Dim str As String = Nothing

        Console.WriteLine("Enter data to Write into File : ")
        str = Console.ReadLine()

        File.WriteAllText("sample.txt", str)
        Console.WriteLine("File Creation Done")
    End Sub
End Module
Enter data to Write into File :
Hello, how are you.
File Creation Done
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply