Windows窗体上放了一个Textbox个按钮button和button~按button选择excel文件~按button进行相关处理
Code Snippet private void button_click(object sendeerEventArgs e)
{ OpenFileDialog openFiledialog=new OpenFileDialog();openFileDialgfilter=Excel文件|*xls; openFileDialgShowDialog();textBoxText=openFileDialogFileName;} private void button_click(object sender EventArg e)
{ DataSet dt=ReadExcel(textBoxText);//然后进行您需要的数据处理}