解析 Google 翻译 Json C#
我正在尝试使用 System.Runtime.Serialization.Json 库解析一些 JSON。该文档似乎有点稀疏,我对如何完成我需要的内容感到困惑。这是我需要解析的 JSON 格式。
{
"data": {
"translations": [
{
"translatedText": "ne",
"detectedSourceLanguage": "en"
}
]
}
}
I'm trying to parse some JSON using the System.Runtime.Serialization.Json
library. The documentation seems a little sparse and I'm confused as to how to accomplish what I need. Here is the format for the JSON I need to parse through.
{
"data": {
"translations": [
{
"translatedText": "ne",
"detectedSourceLanguage": "en"
}
]
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一组表示您拥有的 JSON 数据结构的类。我选择的名称将帮助您将类型与 JSON 字符串中的位置关联起来。
下面是将 JSON 字符串反序列化为该结构的示例。
Here is a set of classes that represent the JSON data structure you have. I have chosen names that will help you correlate the type with the location in the JSON string.
Now the following is an example of deserializing your JSON string into this structure.