PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework FileIOPermission usage

Reply

FileIOPermission usage

 
Thread Tools Rate Thread
Old 15-02-2007, 01:48 AM   #1
=?Utf-8?B?dHRydWRlYXU=?=
Guest
 
Posts: n/a
Default FileIOPermission usage


I read in an old response to a question about the FileIOPermission (from May
5, 2006) that you could use the security imperatively using something like:

FileIOPermission perm = new FileIOPermission(FileIOPermissionAccess.Read,
path);
perm.Demand();

However, code analysis barks at this method with the following:

CA2103
A method uses imperative security and might be constructing the permission
using state information or return values that can change while the demand is
active.

So, how exactly should we employ demands when the path changes as the method
is called?


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off