I am using following code. The file gets created but content of the file always empty. can some one correct my code?
StreamWriter fileWriter; // writes data to text file
FileStream output; // maintains connection to file
string fileName = @"c:\apsdata\br\junk.txt";
// open file with write access
output = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.Write);
// sets file to where data is written
fileWriter = new StreamWriter(output);
fileWriter.WriteLine(fileName);
thanks
nath


Reply With Quote
