using System; using System.Collections.Generic; using System.Text; using System.Security.Permissions; class Program { static void Main(string[] args) { MyClass.Method(); } } [FileIOPermission(SecurityAction.Assert, Read = "C:/")] class MyClass { public static void Method() { // implementation goes here } }