文件名称:弹出打开文件对话框
文件大小:457B
文件格式:TXT
更新时间:2015-12-01 02:49:29
打开文件
CFileDialog *lpszOpenFile; CStdioFile file; CString filePathName; CString result; lpszOpenFile=new CFileDialog(TRUE,"","",OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,"配置文件(*.INI)|*.INI|"); if(lpszOpenFile->DoModal()==IDOK) { filePathName=lpszOpenFile->GetPathName(); SetDlgItemText(IDC_EDIT1,filePathName); } if(filePathName=="") return; if(!file.Open(filePathName,CFile::modeRead)) { MessageBox("Can not open file!"); return; }