private void 式神名称button_Click(object sender, EventArgs e) { if (式神名称comboBox.Text != "" || 线索名称comboBox.Text != "") { SQLiteDataReader sdr6 = MySQLiteClass.Getmysqlread("select 妖怪 from Explore where 线索 ='" + 线索名称comboBox.Text + "'"); sdr6.Read(); string heroName = ""; if (式神名称comboBox.Text == "" && 线索名称comboBox.Text != "") { heroName = sdr6["妖怪"].ToString(); } else { heroName = 式神名称comboBox.Text.Substring(2, 式神名称comboBox.Text.Length - 2); } 探索副本richTextBox.Text = ""; 御魂副本richTextBox.Text = ""; 秘闻副本richTextBox.Text = ""; 妖气封印richTextBox.Text = ""; 线索label1.Text = ""; SQLiteDataReader sdr1 = MySQLiteClass.Getmysqlread("select 探索副本,探索妖怪 from Explore where 探索妖怪 like '%" + heroName + "*%'"); while (sdr1.Read()) { 探索副本richTextBox.Text += sdr1["探索副本"].ToString() + ":" + sdr1["探索妖怪"].ToString() + "\n"; } SQLiteDataReader sdr2 = MySQLiteClass.Getmysqlread("select 御魂副本,御魂妖怪 from Explore where 御魂妖怪 like '%" + heroName + "*%'"); while (sdr2.Read()) { 御魂副本richTextBox.Text += sdr2["御魂副本"].ToString() + ":" + sdr2["御魂妖怪"].ToString() + "\n"; } SQLiteDataReader sdr3 = MySQLiteClass.Getmysqlread("select 秘闻副本,秘闻妖怪 from Explore where 秘闻妖怪 like '%" + heroName + "*%'"); while (sdr3.Read()) { 秘闻副本richTextBox.Text += sdr3["秘闻副本"].ToString() + ":" + sdr3["秘闻妖怪"].ToString() + "\n"; } SQLiteDataReader sdr4 = MySQLiteClass.Getmysqlread("select 妖气封印,妖气妖怪 from Explore where 妖气妖怪 like '%" + heroName + "*%'"); while (sdr4.Read()) { 妖气封印richTextBox.Text += sdr4["妖气封印"].ToString() + ":" + sdr4["妖气妖怪"].ToString() + "\n"; } SQLiteDataReader sdr5 = MySQLiteClass.Getmysqlread("select 线索 from Explore where 妖怪 ='" + heroName + "'"); while (sdr5.Read()) { 线索label1.Text = sdr5["线索"].ToString(); } MySQLiteClass.Getsqlitecon().Close(); if (img != null) { img.Dispose(); } img = Image.FromFile(@"" + str1 + "\\Images\\" + heroName + ".png");//双引号里是图片的路径 pictureBox1.Image = img; 姓名label1.Text = heroName; 式神名称comboBox.Text = null; 线索名称comboBox.Text = null; } }
private void Follow_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.S) { startPoint1 = new Point(200, 100); endPoint1 = new Point(300, 160); for (int i = startPoint1.X + (endPoint1.X - startPoint1.X) / 4; i < endPoint1.X - (endPoint1.X - startPoint1.X) / 4; i++) { for (int j = startPoint1.Y + (endPoint1.Y - startPoint1.Y) / 4; j < endPoint1.Y - (endPoint1.Y - startPoint1.Y) / 4; j++) { initList.Add(new Point(i, j)); } } startFollow = true; timeLabel.Text = "计时:0"; scoreLabel.Text = ""; counter = 0; Timer.Enabled = true; Timer.Start(); } else if (e.KeyCode == Keys.E) { Graphics hitPointGra = this.CreateGraphics(); Brush hitPoint = new SolidBrush(Color.Red); hitPointGra.FillEllipse(hitPoint, Control.MousePosition.X - 115, Control.MousePosition.Y - 73, 7f, 7f); if (isRuin && followTime >= 2) { scoreLabel.Text = "跟踪了" + followTime.ToString() + "秒\n" + "命中目标\n" + "成绩合格"; } else if (isRuin && followTime < 2) { scoreLabel.Text = "跟踪了" + followTime.ToString() + "秒\n" + "命中目标\n" + "成绩不合格"; } else { scoreLabel.Text = "跟踪了" + followTime.ToString() + "秒\n" + "没有命中目标\n" + "成绩不合格"; } MySQLiteClass.Getmysqlcom("insert into ConScore(Number,平稳跟踪目标,训练时间) values('" + MainWindow.number + "','" + scoreLabel.Text + "','" + DateTime.Now.ToString() + "')"); startFollow = false; Timer.Dispose(); Timer.Enabled = false; initList.Clear(); pointList.Clear(); } else if (e.KeyCode == Keys.Escape) { GC.Collect(); this.Dispose(); } }
private void Draw_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.S) { this.Refresh(); SetCursorPos(startPoint1.X + 115, startPoint1.Y + 73); startDraw = true; timeLabel.Text = "计时:0"; scoreLabel.Text = ""; counter = 0; Timer.Enabled = true; Timer.Start(); } else if (e.KeyCode == Keys.E) { startDraw = false; compareList = initList.Intersect(pointList).ToList(); double res = Math.Round((double)compareList.Count * 5 / initList.Count, 2); if (counter < 25 && (res * 100) >= 60) { scoreLabel.Text = "相似度:" + (res * 100).ToString() + "%\n" + "成绩:优秀"; } else if (counter < 30 && (res * 100) >= 45 && (res * 100) < 60) { scoreLabel.Text = "相似度:" + (res * 100).ToString() + "%\n" + "成绩:良好"; } else if (counter < 35 && (res * 100) >= 30 && (res * 100) < 45) { scoreLabel.Text = "相似度:" + (res * 100).ToString() + "%\n" + "成绩:合格"; } else { scoreLabel.Text = "相似度:" + (res * 100).ToString() + "%\n" + "成绩:不及格"; } MySQLiteClass.Getmysqlcom("insert into ConScore(Number,描绘信封靶,训练时间) values('" + MainWindow.number + "','" + scoreLabel.Text + "','" + DateTime.Now.ToString() + "')"); Timer.Dispose(); Timer.Enabled = false; pointList.Clear(); } else if (e.KeyCode == Keys.Escape) { GC.Collect(); this.Dispose(); } }
private void 式神名称button_Click(object sender, EventArgs e) { string heroName = 式神名称textBox.Text; string heroLevel = 稀有度comboBox.Text; if (heroName != "") { dataGridView1.DataSource = MySQLiteClass.Getsqliteset("select * from heroStrategy where 式神名称='" + heroName + "'", "heroStrategy").Tables[0]; } else if (heroName == "" && heroLevel != "") { dataGridView1.DataSource = MySQLiteClass.Getsqliteset("select * from heroStrategy where 稀有度='" + heroLevel + "'", "heroStrategy").Tables[0]; } else { dataGridView1.DataSource = MySQLiteClass.Getsqliteset("select * from heroStrategy", "heroStrategy").Tables[0]; } MySQLiteClass.Getsqlitecon().Close(); 式神名称textBox.Text = ""; 稀有度comboBox.Text = null; dataGridView1.Columns[0].Width = 100; dataGridView1.Columns[1].Width = 100; }