我在使用 JSON.Net 创建时遇到了一些问题.当我尝试解析它时,它给了我以下错误:
I am having some problems with create with JSON.Net. When I try to parse it, it gives me following error:
阅读完 JSON 内容后遇到的额外文字:
Additional text encountered after finished reading JSON content:
我尝试用 http://json.parser.online.fr/ 验证它说SyntaxError: Unexpected token ".
I tried validating it with http://json.parser.online.fr/ and it says "SyntaxError: Unexpected token ,".
我的 JSON 如下:
My JSON is as below:
{"StaffID":"S01","StaffRank":"Manager"},{"StaffID":"S02","StaffRank":"Waiter"}
如何反序列化?
需要用方括号括起来,表示它是一个数组:
You need to surround that with square brackets, which denotes that it's an array:
[{"StaffID":"S01","StaffRank":"Manager"},{"StaffID":"S02","StaffRank":"Waiter"}]
这篇关于阅读完 JSON 内容后遇到的附加文本:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!