通过JayRock将json与IronPython结合使用
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过JayRock将json与IronPython结合使用相关的知识,希望对你有一定的参考价值。
I have not tried this out yet, but I hope it can convert IronPython types to and from json.
Jayrock supports export and importing value types (structs). Below is an example in an interactive IronPython session where Jayrock is being used to export and import System.Drawing.Point (struct) to and from JSON: IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> clr.AddReference('Jayrock.Json') >>> from Jayrock.Json.Conversion import JsonConvert >>> clr.AddReference('System.Drawing') >>> from System.Drawing import Point >>> print JsonConvert.ExportToString(Point(12,34)) {"x":12,"y":34} >>> print JsonConvert.Import(Point, '{x:12,y:34}') {X=12,Y=34}
以上是关于通过JayRock将json与IronPython结合使用的主要内容,如果未能解决你的问题,请参考以下文章
jqGrid - 如何配置 jsonreader(与 Jayrock 一起使用)?
在 .NET 中使用 Jayrock 不正确地形成 JSON 字符串