windows窗體上放了一個Textbox1,2個按鈕button1和button2~按button1選擇excel文件~按button2進行相關(guān)處理
Code Snippet
PRivate void button1_click(object sendeer,EventArgs e)
{
OpenFileDialog openFiledialog1=new OpenFileDialog();
openFileDialg1.filter="Excel文件|*.xls";
openFileDialg1.ShowDialog();
textBox1.Text=openFileDialog1.FileName;
}
private void button2_click(object sender, EventArg e)
{
DataSet dt=ReadExcel(textBox1.Text);
//然后進行您需要的數(shù)據(jù)處理
}
新聞熱點
疑難解答