Create and configure a FileIOPermission object that represents write access to the a folder. - CSharp File IO

CSharp examples for File IO:Permission

Description

Create and configure a FileIOPermission object that represents write access to the a folder.

Demo Code

using System.Security;
using System.Security.Permissions;
class MainClass// w  w  w. ja va  2s . co  m
{
    private bool canWrite = false;
    public static void Main()
    {
        FileIOPermission fileIOPerm = new FileIOPermission(FileIOPermissionAccess.Write, @"C:\Data");
        bool canWrite = SecurityManager.IsGranted(fileIOPerm);
    }
}

Related Tutorials