Welcome to AspAdvice Sign in | Join | Help

How To Create A Text File

using System;
using System.IO; 

namespace csharp
{
class CreateTextFile
{
static void Main(string[] args)
{
FileInfo fileInfo = null;
FileStream fileStream = null;
if (!File.Exists (@"c:\testfile1.txt"))
{
fileInfo = new FileInfo(@"c:\testfile1.txt");
fileStream = fileInfo.Create( );
Console.WriteLine("File created successfully");
}
}
}
}
Published Tuesday, March 15, 2005 11:33 AM by sswafford
Filed under:

Comments

No Comments

New Comments to this post are disabled