XML文件修改

CDomXmlDocument doc("units");
 ifstream file("g:/1.xml");
 istringstream istring;
 for(int i=0; i<40; ++i)
 file.rdbuf()->stossc();
 
 file>>doc;
 file.close();
 
 ofstream file1("g:/file4.xml",ios::binary);
 file1<<"<?xml version=\"1.0\" encoding=\"gb2312\"?>\n";
 file1.close();
 file1.open("g:/file4.xml",ios::binary|ios.app);
 file1<<doc;
 file1.close();

posted @ 2009-07-02 20:53  Skyman  阅读(317)  评论(0编辑  收藏  举报