JSON字符串列表或其他可用的格式在asp.net 2.0中(JSON string to list or other usable format in asp.net 2.0)

编程入门 行业动态 更新时间:2024-10-27 12:38:54
JSON字符串列表或其他可用的格式在asp.net 2.0中(JSON string to list or other usable format in asp.net 2.0)

我有一个string格式的JSON 。 我需要将它存储在key-pair值或类似的东西中。 我使用的是asp.net 2.0 ,不能像Newtonsoft.Json.dll那样使用第三方DLL 。 我想最后的选择将是使用regular expression 。

任何人都可以帮助我吗?

I have one JSON that is coming in a string format. I need to store it in a key-pair value or something like that. I am using asp.net 2.0 and can not use 3rd party DLL like Newtonsoft.Json.dll. I guess last option will be to use regular expression.

Can anybody please help me in this?

最满意答案

如果您访问http://www.json.org/并查看页面底部,则会有几十个json库,其中大多数是开源的,我相信它们会列出C#的8个。 如果您不能参考这些库中的一个,我认为您最好的选择是找到一个拥有许可许可证的人,并简单地将代码添加到您的项目中。

另一个想法是在http://www.json.org/查看图表,语法和语法,然后编写自己的解析器,但是正则表达式不是这样做的。 如果你不知道如何编写解析器,你可以看看其中一个开源的json库或者像一个好的CSV解析器那样简单的东西开始,这里有一篇看起来很不错的文章: http : //www.boyet.com /Articles/CsvParser.html

If you go to http://www.json.org/ and look towards the bottom of the page there are dozens of json libraries most of them open source, I believe they list 8 for C#. If you can not reference one of these libraries, I think your best bet would be to find one with a permissive license and simply add the code to your project.

Another idea is to look at the diagrams, grammer, and syntax at http://www.json.org/ and just write your own parser, but regex is NOT the way to do it. If you dont know how to write a parser you could look at one of the open source json libraries or start with something less complicated like a good CSV parser, here is a paper that looks pretty good: http://www.boyet.com/Articles/CsvParser.html

更多推荐

本文发布于:2023-08-06 18:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1453760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   格式   列表   asp   JSON

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!