• VS中一个强大的功能,将Json或者XML黏贴为类


    有时候需要传递json,或者是json结构复杂,看的杂乱无章,我们可以将这个json复制下来,然后将它写成类的形式,VS中已经帮我们很好的实现了这个功能,我们只需要选择   编辑===>> 选择性粘帖==>>将json复制为类

    这是我的json文件===>>

    {
    "PT": {
    "woman": {
    "gang": [
    "Woman_Gang"
    ],
    "angang": [
    "Woman_Gang"
    ],
    "peng": [
    "Woman_Peng"
    ],
    "hu": [
    "Woman_Hu"
    ],
    "zimo": [
    "Woman_Zimo"
    ],
    "chi": [
    "Woman_Chi"
    ],
    "shi": [
    "Woman_Shi"
    ],
    "shuai": [
    "Woman_Shuai"
    ],
    "ting": [
    "Woman_Ting"
    ],
    "chat": [
    "fix_msg_0",
    "fix_msg_1",
    "fix_msg_2",
    "fix_msg_3",
    "fix_msg_4",
    "fix_msg_5",
    "fix_msg_6",
    "fix_msg_7"
    ],
    "tile": [
    [
    "tile_0_1"
    ],
    [
    "tile_1_1"
    ],
    [
    "tile_2_1"
    ],
    [
    "tile_3_1"
    ],
    [
    "tile_4_1"
    ],
    [
    "tile_5_1"
    ],
    [
    "tile_6_1"
    ],
    [
    "tile_7_1"
    ],
    [
    "tile_8_1"
    ],
    [
    "tile_9_1"
    ],
    [
    "tile_10_1"
    ],
    [
    "tile_11_1"
    ],
    [
    "tile_12_1"
    ],
    [
    "tile_13_1"
    ],
    [
    "tile_14_1"
    ],
    [
    "tile_15_1"
    ],
    [
    "tile_16_1"
    ],
    [
    "tile_17_1"
    ],
    [
    "tile_18_1"
    ],
    [
    "tile_19_1"
    ],
    [
    "tile_20_1"
    ],
    [
    "tile_21_1"
    ],
    [
    "tile_22_1"
    ],
    [
    "tile_23_1"
    ],
    [
    "tile_24_1"
    ],
    [
    "tile_25_1"
    ],
    [
    "tile_26_1"
    ],
    [
    "tile_27_1"
    ],
    [
    "tile_28_1"
    ],
    [
    "tile_29_1"
    ],
    [
    "tile_30_1"
    ],
    [
    "tile_31_1"
    ],
    [
    "tile_32_1"
    ],
    [
    "tile_33_1"
    ]
    ],
    "sendcoin": [
    "sendBet"
    ],
    "genzhu": [ "Genzhu1" ],
    "jiazhu": [ "Jazhu1" ],
    "kanpai": [ "Kanpai1" ],
    "pk": [ "PK1" ],
    "fangqi": [ "Fangqi1" ]
    },
    "man": {
    "gang": [
    "Man_Gang"
    ],
    "angang": [
    "Man_Gang"
    ],
    "peng": [
    "Man_Peng"
    ],
    "hu": [
    "Man_Hu"
    ],
    "zimo": [
    "Man_Zimo"
    ],
    "chi": [
    "Man_Eat"
    ],
    "shi": [
    "Man_Shi"
    ],
    "shuai": [
    "Man_Shuai"
    ],
    "ting": [
    "Man_Ting"
    ],
    "chat": [
    "fix_msg_9",
    "fix_msg_10",
    "fix_msg_11",
    "fix_msg_12",
    "fix_msg_13",
    "fix_msg_14",
    "fix_msg_15",
    "fix_msg_16"
    ],
    "tile": [
    [
    "tile_0_0"
    ],
    [
    "tile_1_0"
    ],
    [
    "tile_2_0"
    ],
    [
    "tile_3_0"
    ],
    [
    "tile_4_0"
    ],
    [
    "tile_5_0"
    ],
    [
    "tile_6_0"
    ],
    [
    "tile_7_0"
    ],
    [
    "tile_8_0"
    ],
    [
    "tile_9_0"
    ],
    [
    "tile_10_0"
    ],
    [
    "tile_11_0"
    ],
    [
    "tile_12_0"
    ],
    [
    "tile_13_0"
    ],
    [
    "tile_14_0"
    ],
    [
    "tile_15_0"
    ],
    [
    "tile_16_0"
    ],
    [
    "tile_17_0"
    ],
    [
    "tile_18_0"
    ],
    [
    "tile_19_0"
    ],
    [
    "tile_20_0"
    ],
    [
    "tile_21_0"
    ],
    [
    "tile_22_0"
    ],
    [
    "tile_23_0"
    ],
    [
    "tile_24_0"
    ],
    [
    "tile_25_0"
    ],
    [
    "tile_26_0"
    ],
    [
    "tile_27_0"
    ],
    [
    "tile_28_0"
    ],
    [
    "tile_29_0"
    ],
    [
    "tile_30_0"
    ],
    [
    "tile_31_0"
    ],
    [
    "tile_32_0"
    ],
    [
    "tile_33_0"
    ]
    ],
    "sendcoin": [
    "sendBet"
    ],
    "genzhu": [ "Genzhu0" ],
    "jiazhu": [ "Jazhu0" ],
    "kanpai": [ "Kanpai0" ],
    "pk": [ "PK0" ],
    "fangqi": ["Fangqi0"]
    }
    }
    }

    一个播放语音的配置文件,相对来说还是复杂的,但是照样可以转换成类

    我们可以看到,功能异常的强大

  • 相关阅读:
    20180818
    20200817
    [mac操作]程序运行技巧与注意事项
    [py编程]小白新奇的技巧
    [命令]使用的conda命令大全
    【编程】python文件读写
    latex学习
    [记录]菜鸡划水记录
    【pytorch】pytorch入门学习
    pycharm中出现unresolved reference的解决办法
  • 原文地址:https://www.cnblogs.com/lzy575566/p/7895064.html
Copyright © 2020-2023  润新知