/// <summary>
/// 打开文件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
FileDialog oneFileDialog1 = new OpenFileDialog();
//openFileDialog1.InitialDirectory = "C:\\";//这一段代码能够执行。
openFileDialog1.Filter = "Excel文件(*.xls)|*.xls";
openFileDialog1.FilterIndex = 0;
//openFileDialog1.RestoreDirectory = true;
//openFileDialog1.ShowHelp = true;
//openFileDialog1.Title = "打开文件";
openFileDialog1.ShowDialog();
}
C# openFileDialog的使用方法
最新推荐文章于 2024-04-03 12:06:53 发布