I am in the process of learning C# and hit a wall that shows I'm obviously missing something important. The line:
var objWriter = new System.IO.StreamWriter(fileName, False);
In the code below causes an error - the string variable fileName can't be converted to System.IO.Stream and False doesn't exist in the current context. Why?
string message = "Hi There!";
string myDocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string fileName = myDocs + "'\'Test.txt";
if (!System.IO.File.Exists(fileName))
{
System.IO.File.Create(fileName).Dispose();
}
var objWriter = new System.IO.StreamWriter(fileName, False);
objWriter.Write(message);
Console.WriteLine("Message Saved");
objWriter.Close();