XmlDocumentÈçºÎÉú³É±ÕºÏ±ê¼ÇµÄXML - .NET¼¼Êõ / C#
ÎÒÓÃXmlDocumentÉú³ÉXML
XmlElement remarkNode = node.OwnerDocument.CreateElement("remark");
remark1Node.InnerXml = "";
Èç¹ûInnerXml¸³Öµ²»Îª¿Õ£¬ÔòÉú³ÉµÄ±ê¼ÇÊÇûÎÊÌâµÄ£¬±ÈÈ磺<remark>Çë±£Áô°ü×°</remark>
µ«ÊÇÈç¹ûÏñÉÏÃæÒ»ÑùÊÇ¿Õ×Ö·û´®£¬ÔòÉú³ÉµÄ±ê¼Ç¾ÍÊÇÕâÑù<remark/>
ÎÒÏëÇëÎÊ£¬ÔÚ¸³ÖµÎª¿ÕµÄʱºòÔõô²ÅÄÜÉú³É<remark></remark>£¬ÕâÑùµÄЧ¹ûÄØ£¿
<remark/>ºÍ<remark></remark>±¾À´¾ÍÊÇÒ»»ØÊÂ
Ö§³ÖÒ»¸ö£¡
¶¼ÊÇÒ»¸öЧ¹û£¡
½á¹ûÊÇÒ»»ØÊ£¬¿ÉÊÇÈç¹û°ÑÉú³ÉµÄXMLµ±³É×Ö·û´®£¬ÎÒÔÙ±àÂ룬ÄÇ<remark/>ºÍ<remark></remark>¾Í²»Ò»ÑùÁË
òËÆÒÔÇ°ÎÒÒ²Óöµ½¹ýÕâ¸öÎÊÌ⣬ÎÒÖ»ÊÇÔÚremark1Node.InnerXml =" "¸³ÁËÒ»¸ö¿Õ
Ïà¹ØÎÊ´ð£º
21cnµÄÓÊÏ䣬ÔÚoutlookÅäÖúó¿ÉÒÔÕý³£ÊÕ·¢Óʼþ£¬¿ÉÊÇÎÒдÔÚC#ÖоͲ»ÐУ¬»»³ÉÆäËüÓÊÏ䣬163ºÜÔç×¢²áµÄ¡£¿ÉÒÔ·¢ËÍ¡£²éÁ˺ܾã¬Ã»ÓÐÕÒµ½ÔÒò£¬Çë¸ßÊÖ°ïæ½â´ð¡£¡£¡£Ð¡µÜ£¬Ð»ÁË¡£¡£´úÂëÈçÏ£º
private void SendMail ......
<?xml version="1.0"?>
<root>
<status>433</status>
<msg>Õâ¸öÊǺº×Ö</msg>
<serialno>123</serialno>
</root>
ÈçºÎÓÃASP¶ÁÈ¡ statusÖµ ......
ÄÚÈÝÈçÌâ¡£¡£ÔÚC#Àï¸ÄÈçºÎдÄØ£¿
±¾À´Ë¼Â·ÊÇÏȱȶԽڵãÃû³Æ£¬ÈçÊǵĻ°¾Í±£´æҪɾ³ý½ÚµãµÄϱê·ÅÔÚÊý×éÀȻºóÑ»·É¾³ý£¬µ«·¢ÏÖ¡£¡£µ±ÎÒɾ³ýµÚÒ»¸öºó£¬ËùÓнڵãϱêÊýÁ¿¶¼·¢Éú¸Ä±ä¡£¡£
¾Í²»ÄÜÔÙ°´ÕÕ֮ǰ¼Í¼µÄ½Úµã ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......