In this
article I will show you how you can create a blank text file in you application
using c#.net and VB.net.
So here is
the code for creating the blank text file.
C#.NET:
string filePath = "C://Demo/DemoTextFile.txt";
if (!File.Exists(filePath))
{
File.Create(filePath);
}
|
VB.NET:
Dim filePath As String = "C://Demo/DemoTextFile.txt"
If Not File.Exists(filePath) Then
File.Create(filePath)
End If
|
In above
code I have checked if file not exists then only create the file. Now here is
the output. First when we don’t have any file.
And after
creating the file.
0 comments:
Please let me know your view