当前位置:网站首页>使用C#语言来进行json串的接收
使用C#语言来进行json串的接收
2022-07-02 06:27:00 【任亚兵】
使用C#语言来进行json串的接收
使用工具 :vs2019
方法:
1.获取要接受的json对象,比如:
{
“face_token”: “fid”,
“user_list”: [
{
“group_id” : “test1”,
“user_id”: “u333333”,
“user_info”: “Test User”,
“score”: 99.3
}
]
}
2.准备一个实体类接受json对象

3.第一步的json对象复制到剪切板,之后进行如下操作
结果为:
可以看出RootObject中的 user_List[] 数组包含 User_List类
使用使用代码接受对象代码
var result = Client().FaceGetlist(userID, groupID);
JToken jToken = JToken.Parse(result.ToString());
//获取错误码
int error_code = int.Parse(jToken["error_code"].ToString());
if (error_code == 0)
{
string resultString = Convert.ToString(result);
Rootobject rootobject = JsonConvert.DeserializeObject<Rootobject>(resultString);
foreach (var list in rootobject.result.face_list)
{
faceTokenString.Add(Convert.ToString(list.face_token));
}
}
Rootobject rootobject = JsonConvert.DeserializeObject(resultString);来进行接收对象
这是所需要的引用:
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Collections;
using System.Net;
using System.Drawing;
边栏推荐
- 【Programming】
- 【Random Erasing】《Random Erasing Data Augmentation》
- Thesis writing tip2
- What if the laptop can't search the wireless network signal
- 【多模态】CLIP模型
- 浅谈深度学习模型中的后门
- 【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》
- 【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》
- Solve the problem of latex picture floating
- [CVPR‘22 Oral2] TAN: Temporal Alignment Networks for Long-term Video
猜你喜欢

How to turn on night mode on laptop

联邦学习下的数据逆向攻击 -- GradInversion

Eklavya -- infer the parameters of functions in binary files using neural network

【TCDCN】《Facial landmark detection by deep multi-task learning》

Where do you find the materials for those articles that have read 10000?
![Open3d learning notes 1 [first glimpse, file reading]](/img/68/68ea87817dbf788591216a32c9375b.png)
Open3d learning notes 1 [first glimpse, file reading]

【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》

Faster-ILOD、maskrcnn_ Benchmark training coco data set and problem summary

【Batch】learning notes

【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
随机推荐
What if the laptop task manager is gray and unavailable
用MLP代替掉Self-Attention
服务器的内网可以访问,外网却不能访问的问题
Graph Pooling 简析
open3d环境错误汇总
【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
Traditional target detection notes 1__ Viola Jones
【TCDCN】《Facial landmark detection by deep multi-task learning》
Faster-ILOD、maskrcnn_benchmark训练自己的voc数据集及问题汇总
Where do you find the materials for those articles that have read 10000?
Summary of solving the Jetson nano installation onnx error (error: failed building wheel for onnx)
[CVPR‘22 Oral2] TAN: Temporal Alignment Networks for Long-term Video
Apple added the first iPad with lightning interface to the list of retro products
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
【Paper Reading】
[multimodal] clip model
Replace self attention with MLP
Memory model of program
【MobileNet V3】《Searching for MobileNetV3》
The difference and understanding between generative model and discriminant model