新手提问 C# OpenFileDialog问题 建立一个打开excel的路径
新手提问C#OpenFileDialog问题建立一个打开excel的路径voidOpenFileDialog1FileOk(objectsender,System.Com...
新手提问 C# OpenFileDialog问题 建立一个打开excel的路径
void OpenFileDialog1FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
OpenFileDialog openFileDialog=new OpenFileDialog();
openFileDialog.InitialDirectory="c:\\";
openFileDialog.Title = "选择导入的文件";
openFileDialog.Filter="excel file|*.*|.xls|所有文件|*.*";
openFileDialog.FilterIndex=1;
if (openFileDialog.ShowDialog()==DialogResult.OK)
{
this.path.Text = openFileDialog.FileName;
}
}
貌似就是 this.path.Text = openFileDialog.FileName; 这句出问题 那里错了 望高手解答 展开
void OpenFileDialog1FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
OpenFileDialog openFileDialog=new OpenFileDialog();
openFileDialog.InitialDirectory="c:\\";
openFileDialog.Title = "选择导入的文件";
openFileDialog.Filter="excel file|*.*|.xls|所有文件|*.*";
openFileDialog.FilterIndex=1;
if (openFileDialog.ShowDialog()==DialogResult.OK)
{
this.path.Text = openFileDialog.FileName;
}
}
貌似就是 this.path.Text = openFileDialog.FileName; 这句出问题 那里错了 望高手解答 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询