ÓÃVC++2005¶ÁXMLÎļþµÄСÀý×Ó
1¡£Ð´Ò»¸öxmlÎļþ
<?xml version="1.0" encoding="utf-8" ?>
- <root>
- <user id="101">
<name>abc</name>
<password>abc</password>
</user>
- <user id="102">
<name>ccc</name>
<password>ccc</password>
</user>
</root>
2¡£Ð½¨Ò»¸övc++2005¹¤³Ì ¿ÉÒÔÊǶԻ°¿ò¹¤³Ì ÒòΪֻÊǾÙÀý˵Ã÷
£¨1£©ÔÚ¶Ô»°¿òµÄ.HÎļþÌí¼Ó
#import "msxml3.dll"
using namespace MSXML2;
£¨2£©ÔÚ³õʼ»¯º¯ÊýÀïÌí¼Ó
try
{
CoInitialize(NULL);//³õʼ»¯COM×é¼þ
MSXML2::IXMLDOMDocumentPtr pDoc;
HRESULT hr=pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument)) ;//´´½¨Ò»¸öCOM½ø³Ì
if(!SUCCEEDED(hr))
{
AfxMessageBox(_T("FAILSE"),MB_OK,NULL);
}
pDoc->load("d:\\user.xml");//xmlÎļþµÄµØÖ· ÎÒ·ÅÔÚDÅÌÏÂÁË Ò²¿ÉÒÔд³ÉÏà¶ÔµØÖ·
MSXML2::IXMLDOMNodeListPtr pNodeList=NULL;//¶¨Òå½ÚµãÁбí
pNodeList=pDoc->selectNodes("root/user");//Ñ¡Ôñ½Úµã
MSXML2::IXMLDOMNodePtr pSubNode;
CString strTemp;
for(int i=0;i<(pNodeList->Getlength());i++)//ÅжÏÓм¸¸ö½Úµã
{
pSubNode=pNodeList->nextNode()->selectSingleNode("name");
_bstr_t strRequestType=pSubNode->Gettext();
strTemp=strRequestType.operator char*();
AfxMessageBox(strTemp,MB_OK,NULL);
}
}
catch (...)
{
AfxMessageBox(_T("Òì³£"));
}
Ïà¹ØÎĵµ£º
һƪ½²¶ÔÆë±È½ÏºÃµÄÎÄÕ£¬×ªÌùÈçÏÂ:
´óÖ±ê×¢Ò»¶þ:
1.ÄÚ´æ¶ÔÆë:¼ÆËã»úϵͳ¶Ô»ù±¾ÀàÐÍÊý¾ÝÔÚÄÚ´æÖдæ·ÅµÄλÖÃÓÐÏÞÖÆ£¬ËüÃÇ»áÒªÇóÕâЩÊý¾ÝµÄÊ×µØÖ·µÄÖµÊÇij¸öÊýk(ͨ³£ËüΪ4»ò8)µÄ±¶ÊýkÔò±»³ÆÎª¸ÃÊý¾ÝÀàÐÍµÄ¶ÔÆëÄ£Êý(alignment modulus)
2.²»Í¬±àÒëÆ÷ĬÈϵÄ×î´ó¶ÔÆë×Ö½ÚÊýÊDz»Ò»ÑùµÄ,±ÈÈçvc==8,gcc==4,¿ÉÒÔͨ¹ ......
Óô˷¨Ç°È·±£ÄãµÄCÔ´´úÂëÊÇÎÞ´íµÄ~~
½â¾ö°ì·¨£º
C:
ÔÚÖ÷º¯Êýºó¼Ógetch()»òch=getch(); (ÈóÌÐòµÈ´ýÄã°´ÏÂÈÎÒâ¼ü£¬ÔÙ¼ÌÐøÖ´ÐÐÏÂÃæµÄÓï¾ä)
C++:
1.°üº¬Í·Îļþʱ£º #include <stdlib.h>/*header file£¬ÒòΪÔÚstdlib.hÍ·ÎļþÖж¨ÒåÁËsystem()º¯Êý*/
2.ÔÚ×îºóÒ»¾ä¼ÓÉÏ£ºsystem("PAUSE ......
xml:
<?xml version="1.0" encoding="utf-8" ?>
<library>
<name>Ê×¶¼Í¼Êé¹Ý</name>
<address>³¯ÑôÇø»ªÍþÇÅÄÏ</address>
<books>
<book>
<id>0000</id>
</book>
< ......
OpenGL + C++ + Java
Õâ¸ö×éºÏÓÐÒ»µãÆæ¹Ö£¬ÒòΪҪʵÏÖÔÚ
opengl
Öв¥·ÅÊÓÆµ£¬ËùÒÔ²»µÃ²»ÓÐÕâÑùÆæ¹ÖµÄ×éºÏ¡£ÉϲãµÄ
MediaPlayer
·â×°µÄ»ù±¾ÉÏÊÇÕë¶Ô
android UI
µÄ¿ò¼Ü£¬Èç¹ûÏëÔÚ
opengl
ÖÐÏÔʾ£¬¹À¼ÆÄѶȺܴó¡£ÁíÍ⣬ºÜ¶à¿ªÔ´µÄ
opengl
µÄÓÎÏ·»ù±¾É϶¼ÊÇ
C++
±àд£¬ËùÒÔÕâ¸öÌåϵµÄ×÷Óû¹ÊǺܴóµÄ£¬Ö®ËùÒÔÐè ......
xml£º
<?xml version="1.0" encoding="utf-8" ?>
<library>
<name>Ê×¶¼Í¼Êé¹Ý</name>
<address>³¯ÑôÇø»ªÍþÇÅÄÏ</address>
<books>
<book type="math">
<id>0000</id>
</book&g ......