System Security Permissions C# by API

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