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);
轉載於:http://blog.csdn.net/chaoguodong/article/details/7349022