当前位置:网站首页>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;
边栏推荐
- Static library and dynamic library
- Specification for package drawing
- Summary of one question per day: linked list (continuously updated)
- Erase method in string
- 用于类别增量学习的动态可扩展表征 -- DER
- Eklavya -- infer the parameters of functions in binary files using neural network
- In the era of short video, how to ensure that works are more popular?
- Go functions make, slice, append
- Longest isometric subsequence
- 用C# 语言实现MYSQL 真分页
猜你喜欢
Embedding malware into neural networks
针对语义分割的真实世界的对抗样本攻击
I'll show you why you don't need to log in every time you use Taobao, jd.com, etc?
11月24号,我们为“满月”庆祝
将恶意软件嵌入到神经网络中
Animation synchronization of CarSim real-time simulation
针对tqdm和print的顺序问题
w10升级至W11系统,黑屏但鼠标与桌面快捷方式能用,如何解决
EKLAVYA -- 利用神经网络推断二进制文件中函数的参数
Open3d learning note 3 [sampling and voxelization]
随机推荐
Carsim-实时仿真的动画同步问题
It's great to save 10000 pictures of girls
業務架構圖
Opencv common method source link (continuous update)
针对tqdm和print的顺序问题
Global and Chinese markets for Salmonella typhi nucleic acid detection kits 2022-2028: Research Report on technology, participants, trends, market size and share
Sqlyog remote connection to MySQL database under centos7 system
Longest isometric subsequence
Replace self attention with MLP
install.img制作方式
浅谈深度学习中的对抗样本及其生成方法
多站点高可用部署
Command line is too long
针对语义分割的真实世界的对抗样本攻击
AR系统总结收获
Where do you find the materials for those articles that have read 10000?
联邦学习下的数据逆向攻击 -- GradInversion
Li Kou daily one question brushing summary: binary tree chapter (continuous update)
Brief introduction of prompt paradigm
包图画法注意规范