1.创建目录(API)
- BOOL CreateDirectory(LPCTSTR pstrDirName);//pstrDirName是全路径
2.删除目录(API)
- BOOL RemoveDirectory( LPCTSTR lpPathName );
3.判断目录是否存在(Shell Function)
- #include <shlwapi.h>
- #pragma comment(lib, "shlwapi.lib")
- if (PathIsDirectory(_T("d://temp")))
- {
- AfxMessageBox(_T("存在"));
- }
- else
- {
- AfxMessageBox(_T("不存在"));
- }
4.取得当前目录(API)
- DWORD GetCurrentDirectory( DWORD nBufferLength, LPTSTR lpBuffer );
5.取得执行文件所在目录(API)
- DWORD GetModuleFileName( HMODULE hModule, LPTSTR lpFilename, DWORD nSize );
6.取得功能目录(Shell Function)
- BOOL SHGetSpecialFolderPath( HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate);
转载于: