SecurityAction.RequestRefuse
using System.Security.Permissions; [assembly:FileIOPermission(SecurityAction.RequestRefuse, Write = @"C:\")] class MainClass{ public static void Main(){ } }