2013年9月5日

清空并写文件

摘要: 1、利用文件的读写功能,若文件存在,则自动进行覆盖。FILE *fp=fopen("C:\\Test.dat","wb") CStdioFile fp;fp.Open(("C:\\Test.dat",CFile::modeCreate | CFile::modeWrite)) 2、//文件不存在就创建文件,若存在则清空文件)CFile file("C:\\Test.dat",CFile::modeReadWrite|CFile::modeCreate);3、可以先删除,再建立文件DeleteFile("C 阅读全文

posted @ 2013-09-05 15:34 大木哥 阅读(632) 评论(0) 推荐(0) 编辑

VC创建多级目录

摘要: BOOL ForceCreateDirectory(string strDir) { BOOL bRet = FALSE; //确保以"\"结尾,以创建最后一个目录 if(strDir.find_last_of("\\") != strDir.length()-1) { strDir.ap... 阅读全文

posted @ 2013-09-05 15:19 大木哥 阅读(439) 评论(0) 推荐(0) 编辑

导航