Why make an exception in the code is not :
try
{
FileIOPermission FIP = new FileIOPermission(FileIOPermissionAccess.Write, @"c:\SD.txt");
FIP.Demand();//Exception must rise here
StreamWriter SW = new StreamWriter(@"c:\SD.txt");//but Exception rise here
SW.Write(textBox1.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
The following code should generate an exception in Windows Vista do
FIP.Demand();//Exception must rise here
Why not create?
My OS : Vista