private void process1_Load(object sender, EventArgs e) { this.Resize += new EventHandler(Form1_Resize); //窗体调整大小时引发事件 X = this.Width; //获取窗体的宽度 Y = this.Height; //获取窗体的高度 setTag(this); //调用方法 label2.Left = label1.Right; dataGridView1.DataSource = helper.SelectMysqlreturnDataset("select process,product,type from Keyprocess").ToString(); string path1 = helper.ExecuteScalar("select PathProcess from T_OKKEN where product_type='" + label2.Text + "'").ToString(); MessageBox.Show(path1); DirectoryInfo dir = new DirectoryInfo(@"c:\\123"); FileInfo[] fil = dir.GetFiles(); process1 pro = new process1(); foreach (FileInfo f in fil) { long size = f.Length; //listBox1.Items.Add(f.Name);//添加文件路径到列表中 } }
private void button3_Click(object sender, EventArgs e) { process1 pro = new process1(); string abc = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); pro.label1.Text = comboBox1.Text; pro.label2.Text = abc + " WI Introduction"; pro.ShowDialog(); }