Overview

Imperative Security

FileIOPermission fileIOPermission = new FileIOPermission(PermissionState.None);
fileIOPermission.AllLocalFiles = FileIOPermissionAccess.Read;
try
{
	fileIOPermission.Demand();
}
catch (SecurityException s)
{
	Console.WriteLine(s.Message);
}

Declarative Security