zoukankan      html  css  js  c++  java
  • LauncherClass

    using System;
    using System.Reflection;
    using System.Runtime.Remoting;
    using System.Threading;
    using System.Security.Permissions;
    using System.Security.Policy;
    using System.Security.Principal;

    namespace PPLauncher
    {
        class LauncherClass
        {
            [STAThread]
            static void Main(string[] args)
            {
                try
                {
                    AppDomain newAD = AppDomain.CreateDomain("ApressDomain");
                    //  The principal will always be based on the Windows identity.
                    String[] adRole = {"BigBucksClub"};
                    IIdentity adRoleIdentity = new GenericIdentity(@"WEINSTEFANER\Administrator");
                    Console.WriteLine("Creating the AD role principal.");
                    IPrincipal adRolePrincipal = new GenericPrincipal(adRoleIdentity, adRole);
                    
                    newAD.SetThreadPrincipal(new WindowsPrincipal(WindowsIdentity.GetCurrent()));
                    //  Now restrict this change for all download callers.
                    SecurityPermission sp = new SecurityPermission(SecurityPermissionFlag.ControlPrincipal);
                    sp.Deny();
                    
                    int ret = newAD.ExecuteAssembly(@"D:\assembly\PPTester.exe");
                }
                catch(Exception ex)
                {
                    Console.WriteLine(
                        ex.ToString());
                }    
            }
        }
    }
  • 相关阅读:
    FPGA-中值滤波
    FPGA-中值滤波
    FPGA-shift_ram代码
    FPGA实现-shift_ram_3x3矩阵实现
    图像处理-中值滤波
    python-str
    ignore-certificate-errors(chrome)
    selenium-python-Cookie跳过登录验证码
    Angular2
    Angular2
  • 原文地址:https://www.cnblogs.com/shihao/p/2511956.html
Copyright © 2011-2022 走看看