Create Evidence : Evidence : Security C# Examples


C# Examples » Security » Evidence »

 

Create Evidence









    
using  System;
using  System.Collections.Generic;
using  System.IO;
using  System.IO.IsolatedStorage;
using  System.Net;
using  System.Net.Sockets;
using  System.Reflection;
using  System.Security;
using  System.Security.AccessControl;
using  System.Security.Policy;
using  System.Security.Permissions;
using  System.Security.Principal;
using  System.Text;
using  System.Threading;

public  class  MainClass
{
        public  static  void  Main()
        {
                AppDomain  sandboxAd;
                Evidence  ev  =  new  Evidence();
                ev.AddAssembly(Assembly.GetExecutingAssembly());
                PermissionSet  permSet  =  new  PermissionSet(PermissionState.None);
                permSet.AddPermission(new  SecurityPermission(PermissionState.Unrestricted));
                permSet.AddPermission(new  FileIOPermission(PermissionState.Unrestricted));
                permSet.AddPermission(new  ReflectionPermission(PermissionState.Unrestricted));
                sandboxAd  =  AppDomain.CreateDomain("Sandbox",  ev,  new  AppDomainSetup(),  permSet);
                
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Security
» Evidence