示例#1
0
        private void StartTray()
        {
            ApplicationLoader.PROCESS_INFORMATION procInfo;
            ApplicationLoader.StartProcessAndBypassUAC(@"C:\Windows\System32\notepad.exe", out procInfo);
            return;

            ProcessStartInfo info = new ProcessStartInfo();

            //info.WorkingDirectory = @"D:\work\source\POC\WinServicesControl\WinServicesControl\bin\Release\";
            //info.CreateNoWindow = true;
            //info.UserName = "******";
            //string strPWD = "pronto";
            //SecureString password = new SecureString();
            //foreach (char c in strPWD.ToCharArray())
            //{ password.AppendChar(c); }
            //info.Password = password;
            info.FileName = @"D:\work\source\POC\WinServicesControl\WinServicesControl\bin\Release\WinServicesControl.exe";
            //info.FileName = @"C:\Windows\System32\notepad.exe";
            //info.Arguments = "";
            info.WindowStyle     = ProcessWindowStyle.Normal;
            info.UseShellExecute = false;
            Process pro = Process.Start(info);

            pro.WaitForExit();
        }
示例#2
0
        protected override void OnStart(string[] args)
        {
            String applicationName = "cmd.exe";

            // launch the application
            ApplicationLoader.PROCESS_INFORMATION procInfo;
            ApplicationLoader.StartProcessAndBypassUAC(applicationName, out procInfo);
        }
示例#3
0
文件: Form1.cs 项目: leonchen09/poc
 private void button1_Click(object sender, EventArgs e)
 {
     ApplicationLoader.PROCESS_INFORMATION procInfo;
     ApplicationLoader.StartProcessAndBypassUAC(@"C:\Windows\System32\notepad.exe", out procInfo);
 }