Beispiel #1
0
        private void RegistBtn_Click(object sender, EventArgs e)
        {
            string fullPath = System.Reflection.Assembly.GetAssembly(typeof(Program)).Location;
            int    ExitCode = regCode.RegistAssembly(fullPath);

            if (ExitCode == -1)
            {
                MessageBox.Show("权限提升失败");
            }
            else if (ExitCode == -2)
            {
                MessageBox.Show("发生了未知错误");
            }
            else if (ExitCode == -3)
            {
                MessageBox.Show("操作失败");
            }
            Check_Registered();
        }
Beispiel #2
0
 static int Main(string[] Args)
 {
     if (Args.Length > 0)
     {
         if (Args[0] == "-regist")
         {
             RegCode reg  = new RegCode();
             int     code = reg.RegistAssembly(Application.ExecutablePath);
             return(code);
         }
         if (Args[0] == "-unregist")
         {
             RegCode reg  = new RegCode();
             int     code = reg.UnRegistAssembly(Application.ExecutablePath);
             return(code);
         }
     }
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new ConfigForm());
     return(0);
 }