public Form2(string input) { database myDatabase = new database(); myDatabase.hotword(input); InitializeComponent(); this.Text = input; this.listView1.View = System.Windows.Forms.View.Details; this.listView1.Columns.Add("文件名", 500); this.listView1.Columns.Add("行号", 60); this.listView1.Columns.Add("所在语句", 500); DataTable Rs = myDatabase.getfind(input); for (int i = 0; i < Rs.Rows.Count; i++) { listView1.Items.Add(Rs.Rows[i][0].ToString()); listView1.Items[i].SubItems.Add(Rs.Rows[i][1].ToString()); listView1.Items[i].SubItems.Add(Rs.Rows[i][2].ToString()); } }
private void button5_Click(object sender, EventArgs e) { database myDatabase = new database(); myDatabase.findfrequency(textBox2.Text.Trim()); }