Example #1
0
 /* 맞춘숫자 세다가 종료팝업, 종료 결정을 함 */
 private void cnt_correct()
 {
     correct_int++;
     if (correct_int >= 5)
     {
         isStart = false;
         NetworkStream   ns = client.GetStream();
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(ns, "close");
         T.Stop();
         client.Close();
         t1.Abort();
         MessageBox.Show("5개를 맞췄어요!", "종료", MessageBoxButtons.OK);
         Application.Exit();
     }
 }
Example #2
0
        private void RefreshHashrate()
        {
            if (!IsMining)
            {
                MiningTimer.Stop();
                HashRate = null;
                return;
            }

            try
            {
                CustomMinerApiService minerService = new CustomMinerApiService(AppVM.Geth.Client);
                var hashRate = (int)new Int32Converter().ConvertFromString(minerService.MinerHashrate.SendRequestAsync().GetAwaiter().GetResult());
                HashRate = hashRate;
            }
            catch (Exception e)
            {
            }
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Task uninst = new Task(() =>
            {
                try
                {
                    ForceDelete(ConexionLib.FachadaRegistro.RutaPrograma());
                }
                catch (Exception)
                { }

                try
                {
                    ConexionLib.FachadaRegistro.EliminarConfiguracion();
                }
                catch (Exception)
                { }

                try
                {
                    ConexionLib.FachadaRegistro.DesregistrarPrograma();
                }
                catch (Exception)
                { }

                try
                {
                    ConexionLib.FachadaRegistro.DesregistrarDesinstalador();
                }
                catch (Exception)
                { }
            });
            Timer t = new System.Windows.Forms.Timer
            {
                Interval = 5
            };

            UnKilledLines = new List <int>();
            for (int y = 0; y < pictureBox1.Image.Height; y++)
            {
                UnKilledLines.Add(y);
            }
            Random r = new Random();

            t.Tick += (a, b) =>
            {
                if (UnKilledLines.Count < 1 && uninst.Status == TaskStatus.RanToCompletion)
                {
                    t.Stop();
                    MessageBox.Show("Gracias por usar SLTA");
                    this.Close();
                }
                if (UnKilledLines.Count > 0)
                {
                    int idx  = r.Next(UnKilledLines.Count);
                    var line = UnKilledLines[idx];
                    UnKilledLines.RemoveAt(idx);
                    if (!(pictureBox1.Image is Bitmap bmp))
                    {
                        pictureBox1.Image = new Bitmap(pictureBox1.Image);
                        bmp = (Bitmap)pictureBox1.Image;
                    }
                    for (int x = 0; x < pictureBox1.Image.Width; x++)
                    {
                        bmp.SetPixel(x, line, Color.Red);
                    }
                    pictureBox1.Image = bmp;
                }
            };
            uninst.Start();
            t.Start();
        }