Open the file under the specified path, unlimited file name
来源:互联网 发布:霍金人工智能开场白 编辑:程序博客网 时间:2024/05/22 15:03
void BtnOpenSpecifile(){SHELLEXECUTEINFO shell = { sizeof(shell) };shell.fMask = SEE_MASK_FLAG_DDEWAIT;shell.lpVerb = L"open";CString helppath,fpath;fpath.Format(L"%s\\help",lzy_dir);vector<CString> pdfnames;if (!PathIsDirectory(fpath)){AfxMessageBox(L"没有找到帮助说明,请检查!");return PRO_TK_E_NOT_FOUND;}_Finder(fpath,L"pdf",pdfnames);if (pdfnames.empty()){AfxMessageBox(L"没有找到帮助说明,请检查!");return PRO_TK_E_NOT_FOUND;}helppath.Format(L"%s\\help\\%s",lzy_dir,pdfnames[0]);shell.lpFile = helppath;shell.nShow = SW_SHOWNORMAL;BOOL ret = ShellExecuteEx(&shell);return PRO_TK_NO_ERROR;}
int _Finder(LPCTSTR fpath,CString extension,vector<CString> &asmname)//将路径fpath下的后缀为extension的文件名称保存到asmname中{CFileFind finder;CString strWildcard(fpath);strWildcard += _T("//*.*");BOOL bWorking = finder.FindFile(strWildcard);vector<CString> lf_names;while (bWorking)//遍历文件夹{bWorking = finder.FindNextFile();CString name = finder.GetFileName();int num1 = 0;CString extend1,extend2;num1 = name.Find('.');extend1 = name.Right(name.GetLength() - num1 - 1);extend2 = extend1;int num2 = extend1.Find('.');if (num2 >0){extend2 = extend1.Left(num2);}if(!finder.IsDots())///////////////////////////////////////判断是否为.或..{if (extend2 == extension)//m_ext_now为你要查找的文件扩展名{CString sname;if (num2 !=-1){sname = name.Left(num1+num2+1);}elsesname = name;asmname.push_back(sname);}}} sort(asmname.begin(),asmname.end());asmname.erase( unique(asmname.begin(),asmname.end()), asmname.end() );return 1;}
0 0
- Open the file under the specified path, unlimited file name
- QFile::open: No file name specified
- Removing the trailing file name and backslash from a path
- AS-package name does not correspond to the file path
- Package name does not correspond to the file path......
- nvm报错 ERROR open \settings.txt: The system cannot find the file specified
- Shrink VmWare File VMDK——Failed to open the disk. The file specified is not a virtual disk
- cannot open the file:mk
- Cornerstone--could not find the specified file
- org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file
- DB2 安装错误 Cannot open database file Error applying transforms. Verify that the specified transform pa
- Can't open file 'folder/.svn/tmp/text-base/file.svn-base': The system cannot find the file specified的实用解决方法
- STSDev失败 The System cannot find the file specified 解决方案
- Error code 2: The system cannot find the file specified.
- java.io.filenotfoundexception: the system cannot find the file specified
- sqlserver The system cannot find the file specified
- How to change the name in open with list / File association.
- java.lang.UnsatisfiedLinkError,(A file or directory in the path name does not exist.
- Python魔法(1)
- [数据结构与算法]队列的优先级
- CryptCreateHash + CALG_MD5
- eclipse的JNI学习
- Delphi 编写IC控件
- Open the file under the specified path, unlimited file name
- uCOS时钟节拍和滴答定时器的关系
- 数据库系统操作备忘(三)
- javascript 循环 while ,for ,switch ,do..while,for ..in
- JDK7的Comparison method violates its general contract异常
- 查看sql语句执行时间/测试sql语句性能
- HDU 4638 Group 莫队算法
- ARM7 LPC2378 远程升级----扇区
- 工行融e联,绿色通道便捷办理