LoadAndCall() public method

public LoadAndCall ( Array, binary ) : void
binary Array,
return void
コード例 #1
0
    static void Main()
    {
        AppDomain  apd = AppDomain.CreateDomain("newdomain", AppDomain.CurrentDomain.Evidence, AppDomain.CurrentDomain.SetupInformation);
        FileStream fs  = new FileStream("Sumlib.dll", FileMode.Open);

        byte[] asbyte = new byte[fs.Length];
        fs.Read(asbyte, 0, asbyte.Length);
        fs.Close();
        fs.Dispose();
        File.Delete("Sumlib.dll");
        AssemblyLoader loader = (AssemblyLoader)apd.CreateInstanceAndUnwrap(typeof(AssemblyLoader).Assembly.FullName, typeof(AssemblyLoader).FullName);

        loader.LoadAndCall(asbyte);
        Console.ReadLine();
    }