当前位置:网站首页>Use C language to receive JSON strings
Use C language to receive JSON strings
2022-07-02 08:12:00 【Ren yabing】
Use C# Language to carry on json Receiving of string
Using tools :vs2019
Method :
1. Get what you want to accept json object , such as :
{
“face_token”: “fid”,
“user_list”: [
{
“group_id” : “test1”,
“user_id”: “u333333”,
“user_info”: “Test User”,
“score”: 99.3
}
]
}
2. Prepare an entity class to accept json object

3. First step json Objects are copied to the clipboard , Then proceed as follows 
The result is :
It can be seen that RootObject Medium user_List[] The array contains User_List class
Use code to accept object code
var result = Client().FaceGetlist(userID, groupID);
JToken jToken = JToken.Parse(result.ToString());
// Get error code
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); To receive objects
This is the reference you need :
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;
边栏推荐
- EKLAVYA -- 利用神经网络推断二进制文件中函数的参数
- 业务架构图
- E-R draw clear content
- Backup, recovery and repair of XFS file system
- CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
- Jupyter Notebook常用快捷键(在命令模式中按H也可查看)
- Sequence problem for tqdm and print
- Programmers can only be 35? The 74 year old programmer in the United States has been programming for 57 years and has not retired
- [learning notes] numerical differentiation of back error propagation
- 用MLP代替掉Self-Attention
猜你喜欢

OpenCV 6.4 中值滤波器的使用
![[learning notes] matlab self compiled Gaussian smoother +sobel operator derivation](/img/f1/4afde3a4bf01254b3e3ff8bc659f9c.png)
[learning notes] matlab self compiled Gaussian smoother +sobel operator derivation

Carla-ue4editor import Roadrunner map file (nanny level tutorial)
![[learning notes] matlab self compiled image convolution function](/img/82/43fc8b2546867d89fe2d67881285e9.png)
[learning notes] matlab self compiled image convolution function

It's great to save 10000 pictures of girls

针对语义分割的真实世界的对抗样本攻击

A brief analysis of graph pooling

Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)

Vs code configuration problem

Carsim-問題Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
随机推荐
高中数学必修一
Global and Chinese markets for conventional rubber track 2022-2028: Research Report on technology, participants, trends, market size and share
Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)
力扣每日一题刷题总结:链表篇(持续更新)
Embedding malware into neural networks
OpenCV关于x,y坐标容易混淆的心得
Open3d learning notes II [file reading and writing]
用于类别增量学习的动态可扩展表征 -- DER
CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
I'll show you why you don't need to log in every time you use Taobao, jd.com, etc?
Jupyter Notebook常用快捷键(在命令模式中按H也可查看)
MySQL optimization
Li Kou daily one question brushing summary: binary tree chapter (continuous update)
Graph Pooling 简析
VS Code配置问题
Force buckle method summary: sliding window
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
Go functions make, slice, append
力扣每日一题刷题总结:字符串篇(持续更新)
Media query usage