private void btnOpenFile_Click(object sender, EventArgs e) { OpenFileDialog Openfile = new OpenFileDialog(); if (Openfile.ShowDialog() == DialogResult.OK) { //MessageBox.Show(Openfile.FileName); StaticImage = Openfile.FileName; //执行Halcon的内部方法 HD.GetStaticImage(); } }