C#打开对话框,获取Access数据库文件(.mdb)的路径

C#打开对话框,获取Access数据库文件(.mdb)的路径_第1张图片 

private void picAlonePointsFile_Click(object sender, EventArgs e)
        {
            OpenFileDialog fdlg = new OpenFileDialog();
            fdlg.Title = "Open File Dialog";
            fdlg.InitialDirectory = Path.GetFullPath("./");//@"c:\";
            fdlg.Filter = "Access files (*.mdb)|*.mdb|All files (*.*)|*.*";
            fdlg.FilterIndex = 1;
            fdlg.RestoreDirectory = true;
            if (fdlg.ShowDialog() == DialogResult.OK)
            {
                textBoxScanFilePath.Text = fdlg.FileName;
            }
}

 

你可能感兴趣的:(C#)