How to know is the file exist in C++ - 在C++中如何判断文件是否存在
2009-03-28 23:24
916 查看
void CPrjCFileTestDlg::OnbtnFileIsExist() { // TODO: Add your control notification handler code here FileIsExist("c://aaaa.txt"); FileIsExist("c://prjSendMail.ini"); } bool CPrjCFileTestDlg::FileIsExist(LPCTSTR szFileFullPathName) { WIN32_FIND_DATA Win32_Find_Data; HANDLE hFindFile; hFindFile = FindFirstFile(szFileFullPathName,&Win32_Find_Data); if(INVALID_HANDLE_VALUE == hFindFile) { //AfxMessageBox("Not Exist"); return false; } else { //AfxMessageBox("Have Exist"); FindClose(hFindFile); return true; } }
相关文章推荐
- How to get the size of file in C++ - 在C++中如何获取文件的大小
- How to get the file's icon using C++ - 用C++如何获取文件的图标
- <boost -04>如何判断输入文件的类型在给定范围内?how to judge whether given file's extension is within list?
- How to get a type in C++ when its template argument is the argument
- C/C++中如何判断某一文件或目录是否存在
- CL_GUI_FRONTEND_SERVICES=>FILE_EXIST(判断物理文件是否存在)
- how to know wether an element is exist in a html page.
- System.IO.File.Exist(filePath)判断另外一台服务器上某个文件是否存在
- How to avoid Excel from prompting "The file you are trying to open, , is in a different format than specified by the file extension"? (转)
- How to get the password text in a text with password property from another process using C++ - 用C++如何从不同进程获取密码框文本
- How to Use the Dynamic Link Library in C++ Linux (C++调用Delphi写的.so文件)
- File.exists()判断文件是否存在,File.isDirectory()判断目录是否存在
- 本地提交SVN报错 提交文件 is not known to exist in the repository and is not part of the commit, yet its child
- How to know if file is complete on the server using FTP
- How to create an XTR file from XML in Delphi XE4 using XML Mapper?(delphi中如何通过xmlmapper创建xtr文件)
- How to programmatically clear the filesystem memory cache in C++ on a Linux system?
- JAVA之旅(二十八)——File概述,创建,删除,判断文件存在,创建文件夹,判断是否为文件/文件夹,获取信息,文件列表,文件过滤
- How to add icon for the item of ListCtrl using C++ (Mail Attachment ListCtrl) - 如何用C++为ListCtrl的Item添加图标(邮件附件ListCtrl)
- [转]如何删除放置库(How to Delete the Drop Off Library)in SharePoint 2010
- php判断文件存在是用file_exists 还是 is_file