日期:2014-05-17 浏览次数:20569 次
<?xml version="1.0" encoding="utf-16"?> <Response> <Id>e5cd5120-219c-4d84-9b1b-b609ecbab930</Id> <Uid>0</Uid> <Name>王五</Name> <Sex>男</Sex> <DOB>1992-3-12 0:00:00</DOB> <MarrigeStatus>1</MarrigeStatus> <IDType>身份证号</IDType> <IDNo>622723199203211421</IDNo> <Address>北京市丰台区</Address> <Zip>744402</Zip> <TelephoneNo>010-8575742</TelephoneNo> <Mobile>13957841245</Mobile> <CreateDate>2011-6-22 14:02:29</CreateDate> </Response>
public static Object XmlDeserialize(string xml,Type type) { object obj = null; using (FileStream fs = new FileStream(fileName,FileMode.Open,FileAccess.ReadWrite)) { XmlSerializer xs = new XmlSerializer(type); obj = xs.Deserialize(fs); } return obj; }