seabaz2000
IS-IT--Management
Hi
I am attempting to write to a file on page load of a particular page, but when I do so the file doesn't seem to write at all. Here is the code.
I am attempting to write to a file on page load of a particular page, but when I do so the file doesn't seem to write at all. Here is the code.
Code:
FileStream fout;
try
{
fout = new FileStream("test.txt", FileMode.Create);
}
catch (IOException exc)
{
Console.WriteLine(exc.Message + "\nError Opening Output File");
return;
}
try
{
for (char c = 'A'; c <= 'Z'; c++)
fout.WriteByte((byte)c);
}
catch (IOException exc)
{
Console.WriteLine(exc.Message + "File Error");
}
fout.Close();