FileIOPermission
FileIOPermission settings are required for PowerScript system functions in Windows Forms targets.
Permission requirements in Web Forms
For Web Forms targets, file-releated functions require Read, Write, Append and PathDiscovery permissions on the
appname_root directory. For print-related functions, you must set the PrintingPermission value to AllPrinting, in addition to setting Read, Write, and PathDiscover permissions on the
appname_root/print directory.
Permission requirements for Windows Forms
System function | Permission required |
---|---|
AddToLibraryList,DirectoryExists , FileEncoding, FileExists, FileLength, FileLength64, FileRead, FileReadEx, FileSeek, FileSeek64, LibraryDirectory, LibraryDirectoryEx, LibraryExport, PrintBitmap, ProfileInt, ProfileString, SetProfileString, SetLibraryList, ShowHelp, ShowPopupHelp, and XMLParseFile | Read |
FileWrite, FileWriteEx, RemoveDirectory, LibraryCreate, LibraryDelete, and LibraryImport | Write |
FileDelete | Read and Write |
FileOpen | When the FileAccess argument is Read!
When the FileAccess argument is Write!
|
FileCopy (string s, string t) | Read for the source file (first) argument; Write for the target file (second) argument |
FileMove (string s, string t) | Read and Write for the source file (first) argument; Write for the target file (second) argument |
GetFolder | Unrestricted |
GetCurrentDirectory | PathDiscovery for the current directory |
CreateDirectory (string d) | Read for the parent directory; Write for the directory name argument |
Object or control | Function or property | Permission required |
---|---|---|
Animation | AnimationName | Read |
DataWindow | SaveAsAscii , SaveAsFormattedText , SavInk , SaveInkPicture | Write |
ImportFile | Read permission if the (usually second) file name argument is supplied; if file name argument is empty or null, requires OpenSave FileDialogPermission and Unrestricted FileIOPermission | |
SaveAs |
Write permission if the (usually second) file name argument is supplied; if file name argument is empty or null, requires OpenSave FileDialogPermission and Unrestricted FileIOPermission | |
DataWindow (RichText only) | InsertDocument | Read |
DataStore | ImportFile | Read |
SaveAs, SaveAsAscii , SaveAsFormattedText , SavInk , SaveInkPicture | Write | |
DragObject | DragIcon property | Read |
DropDownListBox, ListBox | DirList (string s, uint filetype) | Read and PathDiscovery for the file specification (first) argument |
DropDownPictureListBox, PictureListBox | AddPicture, and PictureName property | Read |
DirList (string s, uint filetype) | Read and PathDiscovery for the file specification (first) argument | |
Graph | ImportFile | Read |
SaveAs | Unrestricted for function with no arguments; Write on the file name (first) argument for function with arguments | |
InkPicture | PictureFileName property | Read |
LoadInk | Read and Write for the file (first) argument | |
LoadPicture | Read for the file (first) argument | |
Save, SaveInk | Write for the file (first) argument and for the current temporary file directory | |
Listview | AddLargePicture, AddSmallPicture, AddStatePicture, and LargePictureName, SmallPictureName, StatePictureName properties | Read |
Picture | PictureName property | Read |
PictureButton | DisabledName, PictureName properties | Read |
RichTextEdit | InsertDocument, InsertPicture | Read |
SaveDocument | Write | |
Treeview | AddPicture, AddStatePicture, and PictureName, StatePictureName properties | Read |
UserObject | PictureName property | Read |
Example 1
This XML example gives Read access to two files and write access to one of those files:
1 |
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="d: est.txt;c:demo.jpg" Write="c:demo.jpg" /> |
Example 2
This example for a Web Forms application grants Read, Write, Append, and PathDiscovery permissions to the main deployment and root directories for the MyWebApp application:
1 |
<IPermission class="FileIOPermission" version="1" Read="MyWebApp_root;MyWebApp" Write="MyWebApp_root;MyWebApp" Append="MyWebApp_root;MyWebApp" PathDiscovery="MyWebApp_root;MyWebApp"/> |