c#读取文件路径并保存在textBox2中

 private void button1_Click_1(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Filter = "Excel文件(*.xls)|*.xls";

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {               
                textBox2.Text = openFileDialog1.FileName;
            }
        }        
原文地址:https://www.cnblogs.com/shouhouxiaomuwu/p/3389623.html