Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux tinyxmlɾ³ýÈÎÒâ¸ø¶¨½Úµã

bool RemoveNode(string& szFileName)
{
  TiXmlDocument myDocument(szFileName);   
   bool loadOkay = myDocument.LoadFile();
   if(loadOkay == false)
    return false;
   //»ñµÃ¸ùÔªËØ
  TiXmlElement *rootElement = myDocument.RootElement();
  if(rootElement == NULL)
   return false;
  //»ñµÃ¸ù½áµã
  TiXmlNode *pRootNode = rootElement->ToElement();
  //»ñµÃ¸ù½áµãϵĵÚÒ»¸öÔªËØ
  TiXmlElement *pChild = rootElement->FirstChildElement();
  //»ñµÃ¸ù½áµãϵĵÚÒ»¸ö½Úµã
  TiXmlNode *pTempNode = pChild->ToElement();
  
  TiXmlAttribute *IDAttribute = NULL;
  
  do
  {
    //»ñµÃ½ÚµãϵÄÔªËØ
    pChild = pTempNode->ToElement();
    IDAttribute = pChild->FirstAttribute();    
    if(strcmp("2", IDAttribute->Value()) == 0)
    {
      rootElement->RemoveChild(pTempNode);
      myDocument.SaveFile(szFileName);
    } 
    if(pTempNode != NULL)
     pTempNode = pTempNode->NextSibling();
  }while(pTempNode);
  
  
  return true; 
}


Ïà¹ØÎĵµ£º

LinuxÃüÁÈëÃÅ

1. cdÃüÁî ¸Ä±äµ±Ç°Ä¿Â¼
cd netseek //½øÈënetseekÕâ¸öĿ¼¡£

cd //Í˳öµ±Ç°Ä¿Â¼¡£
2 .
pwdÃüÁî ²é¿´µ±Ç°ËùÔÚĿ¼ÍêÕû·¾¶

eg: pwd //²é¿´µ±Ç°ËùÔÚĿ¼·¾¶¡£
3. lsÃüÁî ²é¿´Ä¿Â¼»òÕßÎļþµÄÊôÐÔ£¬ÁоٳöÈÎһĿ¼ÏÂÃæµÄÎļþ
eg: ls /usr/man
4. rmÃüÁî 
ɾ³ýÎļþºÍĿ¼
rm -rf   Ŀ¼Ãû×Ö/ ......

ʵÏÖLinuxË«»úÎļþͬ²½rsync

rsync ÓÐʲôͻ³öÓŵãÄØ£¿Ê×ÏÈ£¬Ëü±»Éè¼Æ³ÉÖ»´«ËÍÎļþµÄ²»Í¬²¿·Ö£¬¶ø·Ç´«ËÍÕû¸öÎļþ£¬ÒÔ¼ÓËÙÎļþ´«Êä¡£±ÈÈ磬ÎÒÕýÔÚд×÷±¾ÎÄ£¬ÄÇÎҾͿÉÒÔÏÖÔÚʹÓÃ
rsync ¸´ÖÆÒ»´Î£¬¶øÖ®ºóÔÙ½øÐÐÒ»´Î´«Êä¡£µÚ¶þ´Î£¨µÚÈý´Î¡¢µÚËÄ´Î……£©¸¸×ÓÎļþµÄʱºò£¬rsync
Ö»´«ËÍÎļþµÄ²»Í¬²¿·Ö¡£Õ⽫¼«´óµØ½Úʡʱ¼ä£¬ÌرðÊÇÔÚÈÕ³£±¸·ÝµÄ¹ ......

linuxÄں˻ù±¾Êý¾ÝÀàÐÍ×ܽá


linuxÄں˻ù±¾Êý¾ÝÀàÐÍ×ܽá
¶ÔlinuxÄں˵ÄÊý¾ÝÀàÐÍ×öÒ»ÏÂ×ܽᡣ
ÏÂÃ沿·ÖÄÚÈݲο¼ÁË£ºhttp://book.csdn.net/bookfiles/12/100126.shtml
µ±
Linux
ÄÚºËÔÚÌåϵ½á¹¹²îÒì½Ï´óµÄƽ̨֮¼äÒÆֲʱ£¬»á²úÉúÓëÊý¾ÝÀàÐÍÏà¹ØµÄÎÊÌâ¡£ÔÚ±àÒëÄÚºËʱʹÓÃ
-Wall -Wstrict-prototypes
Ñ¡Ï¿ÉÒÔ±ÜÃâºÜ¶à´íÎóµÄ·¢Éú¡£
ÄÚºËʹÓõĻ ......

linux tinyxml±éÀú

·½·¨Ò»¡¢
bool ReadElemnt(string& szFileName)
{
 TiXmlDocument myDocument(szFileName);   
  bool loadOkay = myDocument.LoadFile();
  if(loadOkay == false)
   return false;
 TiXmlElement *rootElement = myDocument.RootElement();
 if(rootEle ......

linux tinyxmlɾ³ý½Úµã

bool RemoveNode(string& szFileName)
{
  TiXmlDocument myDocument(szFileName);   
   bool loadOkay = myDocument.LoadFile();
   if(loadOkay == false)
    return false;
   //»ñµÃ¸ùÔªËØ
  TiXmlElement *rootElemen ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ