MFC程序中如何创建多级目录
2012-04-18 16:06
267 查看
创建多级目录函数
BOOL mkdirEx(const char* lpPath)
{
CString pathname = lpPath;
if(pathname.Right(1) != "\\")
pathname += "\\" ;
int end = pathname.ReverseFind('\\');
int pt = pathname.Find('\\');
if (pathname[pt-1] == ':')
pt = pathname.Find('\\', pt+1);
CString path;
while(pt != -1 && pt<=end)
{
path = pathname.Left(pt+1);
if(_access(path, 0) == -1)
_mkdir(path);
pt = pathname.Find('\\', pt+1);
}
return true;
}
BOOL mkdirEx(const char* lpPath)
{
CString pathname = lpPath;
if(pathname.Right(1) != "\\")
pathname += "\\" ;
int end = pathname.ReverseFind('\\');
int pt = pathname.Find('\\');
if (pathname[pt-1] == ':')
pt = pathname.Find('\\', pt+1);
CString path;
while(pt != -1 && pt<=end)
{
path = pathname.Left(pt+1);
if(_access(path, 0) == -1)
_mkdir(path);
pt = pathname.Find('\\', pt+1);
}
return true;
}
相关文章推荐
- MFC 对话框程序如何添加目录,工具栏,状态栏
- MFC创建多级目录
- word 2010中如何创建多级目录和多级列表
- 如何运用php函数mkdir创建多级目录
- MFC创建好的对话框如何移植到新程序中
- MFC 创建多级文件目录
- 如何运用php函数mkdir创建多级目录
- MFC如何创建目录
- 如何运用php函数mkdir创建多级目录
- MFC创建多级目录
- mfc判断目录是否存在创建多级目录
- 如何创建 PowerPoint 的 MFC 自动化客户端
- 如何使程序创建的子窗口显示在任务栏上(强制)?
- 如何设置UNIX/Linux中新创建目录或文件的默认权限
- java自动创建多级目录
- QT http练习——创建一个能够下载URL资源的UI程序,并保存到本地指定目录下
- 如何用MFC创建透明画板
- php创建多级目录的两种方法
- mfc对话框程序如何添加背景图片以及使控件背景图片与对话框一致
- 如何基于Symfony Components创建你的php框架(目录)