JSON到XML-存在C#例程吗? [英] JSON to XML - C# routine Exist??

查看:81
本文介绍了JSON到XML-存在C#例程吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将传入的JSON字符串转换为XmlDocument XML数据.我正在C#下使用.NET Framework v1.1,因此无法使用Json.net或MS Ajax扩展.有人可以为我提供一些将JSON转换为XML的C#代码吗?我有一个铅匠发现了C#有用的Xml到Json例程,但是现在我需要反过来了.

谢谢.

I would like to convert my incoming JSON string into a XmlDocument XML data.  I am using .NET Framework v1.1 under C# so cannot use Json.net or the MS Ajax Extension.  Can someone please provide me with some C# code for converting from JSON to XML?  I have aleady found the useful Xml to Json routine for C#  but now i need to go in reverse.

Thanks.

推荐答案

在Framework 3.5中,您可以使用DataContractJsonSerializer序列化JSON,如此处所示的示例.然后,您可以将对象序列化为XML,例如示例
in Framework 3.5 you can serialize JSON with the DataContractJsonSerializer like the example showed in here. Then you can serialize the object into XML like this example 


这篇关于JSON到XML-存在C#例程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆