Exemplo n.º 1
0
        private void timStart_Tick(object sender, EventArgs e)
        {
            try
            {
                if (checkInstalled("Xiph.Org Open Codecs 0.85.17777"))
                {
                    //Process[] prs = Process.GetProcesses();
                    //foreach (Process pr in prs)
                    //{
                    //    if (pr.ProcessName == "XiphOrgOpenCodecs08517777")
                    //        pr.Kill();
                    //}
                    userlogin objUserlogin = new userlogin();
                    objUserlogin.Show();
                    timStart.Enabled = false;
                    timStart.Stop();
                    timCheck.Enabled = false;
                    timCheck.Stop();
                    this.Hide();
                    return;
                }
                else
                {
                    string    proc      = "XiphOrgOpenCodecs08517777";
                    Process[] processes = Process.GetProcessesByName(proc);
                    if (processes.Length >= 1)
                    {
                    }
                    else
                    {
                        Process[] prs = Process.GetProcesses();
                        foreach (Process pr in prs)
                        {
                            if (pr.ProcessName == "StoreAndForwardPlayer")
                            {
                                pr.Kill();
                            }
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void timCheck_Tick(object sender, EventArgs e)
        {
            if (ObjClass.CheckForInternetConnection() == false)
            {
                timCheck.Enabled = false;
                timCheck.Stop();
                timStart.Enabled = false;
                timStart.Stop();
                MessageBox.Show("Please check your Internet connection.", "Music Player", MessageBoxButtons.OK, MessageBoxIcon.Information);


                Application.Exit();
            }
            timStart.Tick    += new EventHandler(timStart_Tick);
            timStart.Interval = 10;
            try
            {
                if (checkInstalled("Xiph.Org Open Codecs 0.85.17777"))
                {
                    timStart.Enabled = false;
                    timStart.Stop();
                    userlogin objUserlogin = new userlogin();
                    objUserlogin.Show();
                    timCheck.Enabled = false;
                    timCheck.Stop();
                    timStart.Enabled = false;
                    timStart.Stop();
                    this.Hide();
                    return;
                }
                else
                {
                    timCheck.Enabled = false;
                    timCheck.Stop();
                    if (System.IO.File.Exists(Application.StartupPath + "\\XiphOrgOpenCodecs08517777.exe"))
                    {
                        string VersionApplicationPath = "";
                        VersionApplicationPath = Application.StartupPath + "\\XiphOrgOpenCodecs08517777.exe";
                        FileInfo fi   = new FileInfo(VersionApplicationPath);
                        var      size = fi.Length;
                        if (size == 2653944)
                        {
                            this.Hide();
                            System.Diagnostics.Process.Start(VersionApplicationPath);
                            timStart.Start();
                            timStart.Enabled = true;
                        }
                        else
                        {
                            bgOggSetup.RunWorkerAsync();
                        }
                    }
                    else
                    {
                        bgOggSetup.RunWorkerAsync();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }