c# JSON字段中有中文字段 读取中文字段中的对应值

   string resultJson = "{\"words_result\":{\"姓名\":{\"location\":{\"top\":646,\"left\":385,\"width\":125,\"height\":48},\"words\":\"李xx\"},\"民族\":{\"location\":{\"top\":729,\"left\":617,\"width\":33,\"height\":40},\"words\":\"汉\"},\"住址\":{\"location\":{\"top\":879,\"left\":362,\"width\":414,\"height\":146},\"words\":\"AABBCC\"},\"公民身份号码\":{\"location\":{\"top\":1076,\"left\":579,\"width\":539,\"height\":49},\"words\":\"150000000000000\"},\"出生\":{\"location\":{\"top\":800,\"left\":362,\"width\":407,\"height\":42},\"words\":\"19000923\"},\"性别\":{\"location\":{\"top\":728,\"left\":378,\"width\":35,\"height\":41},\"words\":\"女\"}},\"words_result_num\":6,\"idcard_number_type\":1,\"image_status\":\"normal\",\"log_id\":1730425829943626979}";

            JObject jsonObject = JObject.Parse(resultJson);

            JObject wordsResult = jsonObject["words_result"] as JObject;



            string name = wordsResult["姓名"]["words"].ToString();

            string nationality = wordsResult["民族"]["words"].ToString();

            string address = wordsResult["住址"]["words"].ToString();

            string idNumber = wordsResult["公民身份号码"]["words"].ToString();

            string birthdate = wordsResult["出生"]["words"].ToString();

            string gender = wordsResult["性别"]["words"].ToString();

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容