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

C#ÐòÁл¯xmlµÄÍêÕûÀý×Ó

C#ÐòÁл¯xml
¹Ø¼ü²½Ö裺
XmlSerializer xSerializer = new XmlSerializer(typeof(MyObj));
StringWriter sWriter = new StringWriter(CultureInfo.InvariantCulture);
XmlTextWriter xTextWriter = new XmlTextWriter(sWriter);
XmlDocument xmlDoc = new XmlDocument();
xSerializer.Serialize(xTextWriter, myObj);
xmlDoc.LoadXml(sWriter.ToString()); 
ÐèҪ˵Ã÷µÄÊÇ£¬Èç¹ûÒªÐòÁл¯µÄobjectËùÔÚµÄÀàÀïÓдø²ÎÊýµÄ¹¹Ô캯Êý£¬»¹±ØÐëÌí¼ÓÒ»¸öÎÞ²ÎÊýµÄ¹¹Ô캯Êý£¬·ñÔò£¬»á±¨object cannot be serialized because it does not have a parameterless constructorµÄ´íÎó¡£ÏÂÃæÊÇÒ»¸öÍêÕûµÄʵÀý£¬½ö¹©²Î¿¼¡£
using System;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
/* The XmlRootAttribute allows you to set an alternate name
(PurchaseOrder) of the XML element, the element namespace; by
default, the XmlSerializer uses the class name. The attribute
also allows you to set the XML namespace for the element. Lastly,
the attribute sets the IsNullable property, which specifies whether
the xsi:null attribute appears if the class instance is set to
a null reference. */
[XmlRootAttribute("PurchaseOrder", Namespace="http://www.cpandl.com",
IsNullable = false)]
public class PurchaseOrder
{
public Address ShipTo;
public string OrderDate;
/* The XmlArrayAttribute changes the XML element name
from the default of "OrderedItems" to "Items". */
[XmlArrayAttribute("Items")]
public OrderedItem[] OrderedItems;
public decimal SubTotal;
public decimal ShipCost;
public decimal TotalCost;
}
public class Address
{
/* The XmlAttribute instructs the XmlSerializer to serialize the Name
field as an XML attribute instead of an XML element (the default
behavior). */
[XmlAttribute]
public string Name;
public string Line1;
/* Setting the IsNull


Ïà¹ØÎĵµ£º

ÏîÄ¿¹¤×÷×ܽá XML Schema£¨±ê×¼½â¶Á£©

        ×î½üÔÚ×öNetConfÏà¹Ø¿ª·¢¹¤×÷£¬ÆäÖкÜÖØÒªµÄÒ»¿éÊÇXML½âÎö£¬ÏîĿҲÐèÒªÖ§³ÖSchema£¬Òò´Ëǰ¶Îʱ¼äÕûÀíÁËSchemaµÄÁ½²¿·Ö±ê×¼£¬Ö»²»¹ýÕûÀíÎĵµÊÇÎÞ·¨´ø³öÀ´µÄ£¬ËùÒÔ¾ÍÔڴ˰ÑSchemaÏà¹ØµÄÄÚÈݼòµ¥½éÉÜÆä±ê×¼Ö®ºó£¬ÒÔÈçºÎÓ¦Óõķ½Ê½¼Ç¼ÏÂÀ´£¬ÒÔ¹©ÒÔºóʹÓÃʱ²Î¿¼¡£ÔÚºóÐøµÄ²¿·Ö£¬ÎÒ» ......

asp /asp.net c#Á´½ÓOrcale Êý¾Ý¿âµÄ·½°¸

1£¬ÔÚweb·þÎñÆ÷Éϰ²×°OracleÊý¾Ý¿â¿Í»§¶Ë£¬ÕâÊÇÁ¬½ÓOracleÊý¾Ý¿âµÄ»ù´¡£¨µ«£¬²»Ò»¶¨ÊDZØÐëµÄ£©¡£
2£¬ÔÚ¿Í»§¶ËµÄNet Manager ÖнøÐÐÅäÖ÷þÎñµÄÃû³Æ£¬ÅäÖÃÈçͼ£¨ÕâÒ»µã·Ç³£µÄÖØÒªÒÔºóµÄÁ´½ÓÈ«¶¼ÔÚÕâ¸ö·þÎñÃû³ÆµÄ»ù´¡ÉϽøÐеģ©
3£¬ASPÁ´½Ó·þÎñµÄÁ´½Ó×Ö·û´®ºÍ·½·¨ÈçÏ£º
<%
connstr= "Provider=MSDAORA.1;Password=***; ......

PHP XML²Ù×÷ÀàDOMDocument

²»µÃ²»×ÔÒÑдһ¸ö.XML
µÄ²Ù×÷һֱûÓÐÓùý.ÏÂÃæÊÇ×Ô¼ºËѼ¯µÄXML²Ù×÷Àà
DOMDocumentÏà¹ØµÄÄÚÈÝ.
ÊôÐÔ:
Attributes ´æ´¢½ÚµãµÄÊôÐÔÁбí(Ö»¶Á)
childNodes
´æ´¢½ÚµãµÄ×Ó½ÚµãÁбí(Ö»¶Á)
dataType ·µ»Ø´Ë½ÚµãµÄÊý¾ÝÀàÐÍ
Definition ÒÔDTD»òXMLģʽ¸ø³öµÄ½ÚµãµÄ¶¨Òå(Ö»¶Á)
Doctype Ö¸¶¨ÎĵµÀàÐͽڵã(Ö»¶Á)
doc ......

C#.NET·ÀÖ¹SQL×¢Èëʽ¹¥»÷

1  ·ÀÖ¹sql×¢Èëʽ¹¥»÷(¿ÉÓÃÓÚUI²ã¿ØÖÆ£© #region  ·ÀÖ¹sql×¢Èëʽ¹¥»÷(¿ÉÓÃÓÚUI²ã¿ØÖÆ£©
  2 
  3   /**/ /// 
  4  ///  ÅжÏ×Ö·û´®ÖÐÊÇ·ñÓÐSQL¹¥»÷´úÂë
  5  /// 
  6  ///  ´«ÈëÓû§Ìá½»Êý¾Ý
  7  ///  ......

ÓÃpython£¬ c#£¬ javaдµÄÎļþ¿½±´

     ǰһ¶Îʱ¼äÊÔ×ÅÓÃÕâÈýÖÖÓïÑÔ¼òµ¥µÄдÁ˹ØÓÚÎļþ¿½±´µÄ³ÌÐò£¬·¢ÏÖc#ºÍpythonµÄapi¾ªÈ˵ÄÏàËÆ£¬¶ÔÓÚÎļþµÄ²Ù×÷ÕâÁ½ÖÖÓïÑԷdz£µÄ·½±ã¡£¶¼Ã»ÓмÓÒì³£µÄ´¦Àí
C#Ô´´úÂ룺
        public static void CopyFile(string source, string destination)
  & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ