using System;
using System.IO;
class TestRW
{
publicstaticvoid Main(String[] args)
{
FileStream fs = new FileStream("MyFile.txt", FileMode.OpenOrCreate, FileAccess.Write);
if (fs.CanRead && fs.CanWrite)
{
Console.WriteLine("MyFile.txt can be both written to and read from.");
}
elseif (fs.CanWrite)
{
Console.WriteLine("MyFile.txt is writable.");
}
}
}