CFileDialog DlgFile(true,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,NULL,NULL); DlgFile.m_ofn.lpstrTitle="打开文件"; DlgFile.m_ofn.nFilterIndex = 0; if ( DlgFile.DoModal() == IDOK) { CString strInputPath = DlgFile.GetPathName(); }