开发者

Exception Production in os vista

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.开发者_JAVA技巧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


You are checking code execute permissions, not actual file permissions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜