I am using the TextWriter to try to write to a hidden file, and it is throwing an exception. I can't seem to figure out how to write to a hidden file.
using (TextWriter tw = new StreamWriter(filename))
{
tw.WriteLine("foo");
tw.Close();
}
Exception:
Unhandled Exception: System.UnauthorizedAccessException:
Access to the path 'E:\*\media\Photos\2006-08\.picasa.ini' is denied.
How can I write to a hidden file?