1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingsystem.web;5 usingSystem.Web.UI;6 usingSystem.Web.UI.WebControls;7 usingSystem.Xml;8 9 namespaceXml2jsonTen { One Public Partial classWebForm1:System.Web.UI.Page A { - protected voidPage_Load (Objectsender, EventArgs e) - { the stringXML =@"<dataestimate> - <ownername>crm06 mobile phone end Zhao ya qi </OwnerName> - <StepName> Zhao ya qi </StepName> - <DEName> test Environment running process---1</dename> + <ID>150F2263-C56A-E611-80C0-00155DB6760B</ID> - <CPName> test Environment running process </CPName> + <accountinfoname>crm06 Exclusive Customer </AccountInfoName> A <AccountName> Addimei </AccountName> at <saler>crm06 mobile phone end Zhao ya qi </Saler> - <salerlist>crm01 Yang Jing </SalerList> - <eftypevalues>1197cf3b-c56a-e611-80c0-00155db6760b;1297cf3b-c56a-e611-80c0-00155db6760b</ Eftypevalues> - <Monitor> is </Monitor> - <Budget>234.00</Budget> - <Reason>2344</Reason> in <OwnerSType>100000000</OwnerSType> - <OPOwnerSType>100000000</OPOwnerSType> to <effecttype> + <effecttype> - <EFID>662AC533-C56A-E611-80C0-00155DB6760B</EFID> the <EFName>CPC</EFName> * </effecttype> $ <effecttype>Panax Notoginseng <EFID>1197CF3B-C56A-E611-80C0-00155DB6760B</EFID> - <EFName>CPM</EFName> the </effecttype> + <effecttype> A <EFID>1297CF3B-C56A-E611-80C0-00155DB6760B</EFID> the <EFName>PV</EFName> + </effecttype> - <effecttype> $ <EFID>D7849F46-C56A-E611-80C0-00155DB6760B</EFID> $ <EFName> Click </EFName> - </effecttype> - </effecttype> the </dataestimate>"; - WuyiXmlDocument doc =NewXmlDocument (); the Doc. LOADXML (XML); - stringJSON =Newtonsoft.Json.JsonConvert.SerializeXmlNode (DOC); Wu - About $ Response.Write (JSON); - - } - } A}View Code
C # Xml2json