Hi sumit1977,
You can use File.WriteAllText Method (String, String)
The first parameter is path and the second one is contents.
C#
string path = "c:\\user\\desktop\\Test.txt";
if (!File.Exists(path))
{
string text= "Welcome to aspforums.net";
File.WriteAllText(path, text);
}
VB.Net
Dim path As String = "c:\\user\\desktop\\Test.txt"
If Not File.Exists(path) Then
Dim text As String = "Welcome to aspforums.net"
File.WriteAllText(path, text)
End If