Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length > 0)
            {
                // md5 part
                MD5    md5       = new MD5CryptoServiceProvider();
                byte[] data      = Encoding.GetEncoding("GB2312").GetBytes(textBox1.Text);
                byte[] OutBytes  = md5.ComputeHash(data);
                string OutString = "";
                for (int i = 0; i < OutBytes.Length; i++)
                {
                    OutString += OutBytes[i].ToString("x2");
                }

                string password = RocTools.ReadTXT("test.txt");
                if (password != OutString)
                {
                    MessageBox.Show("密码不对,程序无法执行。");
                    Environment.Exit(0);
                }
                else
                {
                    Expert expert = new Expert();
                    this.Close();
                }
            }
        }
Example #2
0
        private void show_expert()
        {
            int ren = 1;

            if (comboBox1.SelectedIndex.ToString() == "0" || comboBox1.SelectedIndex.ToString() == "1")
            {
                ren = 1;
            }
            if (comboBox1.SelectedIndex.ToString() == "2")
            {
                ren = 2;
            }
            if (comboBox1.SelectedIndex.ToString() == "3")
            {
                ren = 3;
            }
            if (comboBox1.SelectedIndex.ToString() == "4")
            {
                ren = 4;
            }

            while (!Stop)
            {
                ArrayList Origin    = RocTools.ArrayListCopy(OriginPeopleAl);
                ArrayList arrayList = RocRandom.MyRandom(Origin);
                listBox1.Items.Clear();
                for (int i = 0; i < ren; i++)
                {
                    listBox1.Items.Add(arrayList[i].ToString());
                }
                Application.DoEvents();
            }
        }
Example #3
0
 private void LoadData()
 {
     OriginPeopleAl = RocTools.File2Array(@"d:\yaohao\data\ren.txt");
     listBox1.Items.Clear();
     foreach (object o in OriginPeopleAl)
     {
         listBox1.Items.Add(o.ToString());
     }
     label3.Text     = listBox1.Items[round].ToString();
     button1.Visible = true;
 }
Example #4
0
        private void Scroll()
        {
            label4.Text = "";
            while (!Stop)
            {
                ArrayList Origin    = RocTools.File2Array(@"d:\yaohao\data\fang.txt");
                ArrayList arrayList = RocRandom.MyRandom(Origin);

                for (int i = 0; i < arrayList.Count; i++)
                {
                    label4.Text = arrayList[i].ToString();
                }
                Application.DoEvents();
            }
        }
Example #5
0
        private void ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.CheckFileExists = true;
            ofd.CheckPathExists = true;
            ofd.ValidateNames   = true;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                OriginPeopleAl = RocTools.File2Array(ofd.FileName);
                listBox2.Items.Clear();
                foreach (object o in OriginPeopleAl)
                {
                    listBox2.Items.Add(o.ToString());
                }
                button1.Visible = true;
            }
        }