C++实现的各种小知识整理
1) 获取某个目录下的所有文件:
http://liyi593730139.blog.163.com/blog/static/1764742472012397200474/
2) XML文件的写入
参考:http://blog.csdn.net/qq2399431200/article/details/17583171
头文件:
#include<msxml6.h>
#import <msxml6.dll>
//根据自己的系统选择相应的dll文件
using namespace MSXML2;
MSXML2::IXMLDOMProcessingInstructionPtr pProInstruction; // XML声明
MSXML2::IXMLDOMDocumentPtr doc;
CoInitialize(NULL);
HRESULT HR = doc.CreateInstance(_uuidof(MSXML2::DOMDocument60));
pProInstruction = doc->createProcessingInstruction((_bstr_t)"xml", (_bstr_t)"version=\"1.0\" "); doc->appendChild(pProInstruction);
其他参考链接
如果需要换行,增加:
annotation->appendChild(doc->createTextNode("\n\t"));
......
持续更新中