Ejemplo n.º 1
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            AEStutas aes = nFsAE1.Run();
            string   mes = "";

            switch (aes)
            {
            case AEStutas.None: mes = "失敗?"; break;

            case AEStutas.IsRunStart: mes = "起動成功!"; break;

            case AEStutas.IsRunning: mes = "すでに起動中"; break;
            }
            MessageBox.Show(mes);
        }
Ejemplo n.º 2
0
        // ******************************************************************************
        static public AEStutas CheckRun(string s, out ProcessAE pae)
        {
            AEStutas ret = AEStutas.None;

            ProcessAE[] lst = ProcessAEList();
            pae = new ProcessAE();
            if (lst.Length > 0)
            {
                foreach (ProcessAE p in lst)
                {
                    if (p.VersionStr == s)
                    {
                        ret = AEStutas.IsRunning;
                        pae = p;
                        break;
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 3
0
        // ******************************************************************************
        public AEStutas Run()
        {
            AEStutas ret = AEStutas.None;

            if (m_TargetVersionIndex < 0)
            {
                return(ret);
            }

            try
            {
                string ss = m_InstalledAFX[m_TargetVersionIndex];

                ProcessAE pae;
                AEStutas  aes = CheckRun(ss, out pae);

                if (aes == AEStutas.IsRunning)
                {
                    ret = AEStutas.IsRunning;
                    return(ret);
                }
                string exePath = CombineAE(ss);
                if (File.Exists(exePath) == true)
                {
                    var app = new ProcessStartInfo();
                    app.FileName        = exePath;
                    app.UseShellExecute = true;
                    Process ps = Process.Start(app);
                    if (ps != null)
                    {
                        ret = AEStutas.IsRunStart;
                    }
                }
            }
            catch
            {
                ret = AEStutas.None;
            }
            return(ret);
        }