FileIOPermission issue

  • Thread starter Thread starter Mircea Pleteriu
  • Start date Start date
M

Mircea Pleteriu

Hi all,

I have this code sample

FileIOPermission fp = new FileIOPermission(PermissionState.Unrestricted);

fp.Deny();

StreamWriter sw = new StreamWriter(@"c:\test.txt");

sw.Write("Test");

sw.Close();



I do not understand why the file is still created?
 
I think that
fp.deny only prevents callers of the function from using the functionality.
In the MSDN documentation, they mention that deny prevents callers higher in
the call stack from using the resource.

rc
 
Back
Top