我有一个JSON文件,我想在表中显示其数据

时间:2015-08-14 05:32:09

标签: json vb.net

但我无法理解如何使用JSON Parser。 示例代码请使用我的JSON数据。 提前谢谢..

{"androidDisplayName":"BOQUEO RUFINO RO","androidDescription":"05 17 3 010 99 69","geopoint_hh_ind":"1","geopoint_hh":{"latitude":"13.320313333333335","longitude":"123.66615833333331","altitude":"291.9","accuracy":"9.3"},"regn":"05","prov":"05","mun":"17","zone":"3","brgy":"010","purok":"99","street":"none","hnum":"0","hcn":"69","respondent":"BOQUEO RUFINO","int_date":"2014-07-02","start_time":"12:55","interviewer":"RONALD BONAFUS","house_type":"1","house_type_o":"","nbr":1,"roof":"2","wall":"2","nofw":0,"nnucfam":3,"hpregind":"2","uniparind":"2","disableind":"2","phsize":8,"hpq_mem":[{"memno":"1404302501330","msname":"BOQUEO","mfname":"RUFINO","mmname":"BUESA","nucfam":"1","reln":"1","reln_o":"","sex":"1","birth_date":"1948-04-22","age":66.5160848733744,"age_yr":66,"birth_reg":"1","civstat":"3","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"100","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"1","entrepind":null,"njob":1,"occup":"VEGETABLE FARMER","psoc4":"6114","indust":"AGRICULTURE","psic4":"0118","jstatus":"1","work_ddhrs":6,"work_wkhrs":36,"fadd_work_hrs":"2","fxtra_wrk":"2","workcl":"2","fjob":null,"first_fjob":null,"jsearch_meth":"","jsearch_meth_o":"","wks_fjob":0,"ynotlookjob":"","ynotlookjob_o":"","lastlookjob":"","joppind":null,"wtwind":null,"wagcshm":0,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":"1","pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":"1","mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501331","msname":"BOQUEO","mfname":"EVELYN","mmname":"CA\u00d1ETA","nucfam":"1","reln":"2","reln_o":"","sex":"2","birth_date":"1955-05-30","age":59.41409993155373,"age_yr":59,"birth_reg":"1","civstat":"2","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"100","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"2","entrepind":"2","njob":0,"occup":"","psoc4":"","indust":"","psic4":"","jstatus":"","work_ddhrs":0,"work_wkhrs":0,"fadd_work_hrs":null,"fxtra_wrk":null,"workcl":"","fjob":"2","first_fjob":null,"jsearch_meth":"","jsearch_meth_o":"","wks_fjob":0,"ynotlookjob":"7","ynotlookjob_o":"","lastlookjob":"3","joppind":"2","wtwind":"2","wagcshm":0,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":null,"pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501332","msname":"BOQUEO","mfname":"RONALD","mmname":"CA\u00d1ETA","nucfam":"1","reln":"3","reln_o":"","sex":"1","birth_date":"1987-02-08","age":27.718001368925393,"age_yr":27,"birth_reg":"1","civstat":"1","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"200","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"1","entrepind":null,"njob":1,"occup":"CARETAKER/FISHPOND/PRIVATE","psoc4":"9213","indust":"AQUACULTURE","psic4":"0312","jstatus":"1","work_ddhrs":8,"work_wkhrs":48,"fadd_work_hrs":"2","fxtra_wrk":"2","workcl":"2","fjob":null,"first_fjob":null,"jsearch_meth":"","jsearch_meth_o":"","wks_fjob":0,"ynotlookjob":"","ynotlookjob_o":"","lastlookjob":"","joppind":null,"wtwind":null,"wagcshm":36000,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":"2","pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501333","msname":"BOQUEO","mfname":"DANTE","mmname":"CA\u00d1ETA","nucfam":"1","reln":"3","reln_o":"","sex":"1","birth_date":"1989-07-03","age":25.319758156513803,"age_yr":25,"birth_reg":"1","civstat":"1","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"41","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"2","entrepind":"2","njob":0,"occup":"","psoc4":"","indust":"","psic4":"","jstatus":"","work_ddhrs":0,"work_wkhrs":0,"fadd_work_hrs":null,"fxtra_wrk":null,"workcl":"","fjob":"1","first_fjob":"1","jsearch_meth":"4","jsearch_meth_o":"","wks_fjob":4,"ynotlookjob":"","ynotlookjob_o":"","lastlookjob":"","joppind":"1","wtwind":"1","wagcshm":0,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":"2","pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501334","msname":"RIVERA","mfname":"MARLYN","mmname":"BOQUEO","nucfam":"2","reln":"3","reln_o":"","sex":"2","birth_date":"1979-02-14","age":35.7015742642026,"age_yr":35,"birth_reg":"1","civstat":"3","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"100","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"2","entrepind":"2","njob":0,"occup":"","psoc4":"","indust":"","psic4":"","jstatus":"","work_ddhrs":0,"work_wkhrs":0,"fadd_work_hrs":null,"fxtra_wrk":null,"workcl":"","fjob":"1","first_fjob":"2","jsearch_meth":"4","jsearch_meth_o":"","wks_fjob":4,"ynotlookjob":"","ynotlookjob_o":"","lastlookjob":"","joppind":"1","wtwind":"1","wagcshm":0,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":"2","pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501335","msname":"BOQUEO","mfname":"BERNARD","mmname":"CA\u00d1ETA","nucfam":"3","reln":"3","reln_o":"","sex":"1","birth_date":"1984-06-08","age":30.38740588637919,"age_yr":30,"birth_reg":"1","civstat":"2","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"100","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"1","entrepind":null,"njob":1,"occup":"DRIVER HABAL HABAL","psoc4":"8321","indust":"TRANSPORTATION AND STORAGE","psic4":"4932","jstatus":"1","work_ddhrs":10,"work_wkhrs":60,"fadd_work_hrs":"2","fxtra_wrk":"2","workcl":"4","fjob":null,"first_fjob":null,"jsearch_meth":"","jsearch_meth_o":"","wks_fjob":0,"ynotlookjob":"","ynotlookjob_o":"","lastlookjob":"","joppind":null,"wtwind":null,"wagcshm":100800,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":null,"pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501336","msname":"BOQUEO","mfname":"JOAN","mmname":"RAGODON","nucfam":"3","reln":"4","reln_o":"","sex":"2","birth_date":"1994-07-01","age":20.32580424366872,"age_yr":20,"birth_reg":"1","civstat":"2","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":"1","country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":"2","gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"7","ynotsch_o":"","educal":"100","psced7":"","course_o":"","literind":"1","regvotind":"1","voted_last_election":"1","jobind":"2","entrepind":"2","njob":0,"occup":"","psoc4":"","indust":"","psic4":"","jstatus":"","work_ddhrs":0,"work_wkhrs":0,"fadd_work_hrs":null,"fxtra_wrk":null,"workcl":"","fjob":"2","first_fjob":null,"jsearch_meth":"","jsearch_meth_o":"","wks_fjob":0,"ynotlookjob":"7","ynotlookjob_o":"","lastlookjob":"3","joppind":"2","wtwind":"2","wagcshm":0,"wagkndm":0,"sss_ind":"4","pregind":null,"solo_parent":null,"pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"","mnutind_date":""},{"memno":"1404302501337","msname":"BOQUEO","mfname":"ROCHELL","mmname":"RAGODON","nucfam":"3","reln":"5","reln_o":"","sex":"2","birth_date":"2014-06-07","age":0.3915126625598905,"age_yr":0,"birth_reg":"1","civstat":"1","ethgrp":"37","ethgrp_o":"","ofw":null,"mlenresid":null,"country_resid":"","country_resid_o":"","prov_resid_code":"","mun_resid_code":"","brgy_resid_code":"","mun_resid_txt":"","brgy_resid_txt":"","educind":null,"gradel":"","sch_type":"","gradel_calc":499,"ynotsch":"","ynotsch_o":"","educal":"","psced7":"","course_o":"","literind":null,"regvotind":null,"voted_last_election":null,"jobind":null,"entrepind":null,"njob":0,"occup":"","psoc4":"","indust":"","psic4":"","jstatus":"","work_ddhrs":0,"work_wkhrs":0,"fadd_work_hrs":null,"fxtra_wrk":null,"workcl":"","fjob":null,"first_fjob":null,"jsearch_meth":"","jsearch_meth_o":"","wks_fjob":0,"ynotlookjob":"","ynotlookjob_o":"","lastlookjob":"","joppind":null,"wtwind":null,"wagcshm":0,"wagkndm":0,"sss_ind":null,"pregind":null,"solo_parent":null,"pwd_ind":null,"pwd_type":"","pwd_type_o":"","pwd_id":null,"scid_ind":null,"mcrimeind":"2","mtheftind":null,"mrapeind":null,"minjurind":null,"mcarnapind":null,"mcattrustlind":null,"mocrimind":null,"mocrim":"","mtheftloc":null,"mrapeloc":null,"minjurloc":null,"mcarnaploc":null,"mcattrustlloc":null,"mocrimloc":null,"mnutind":"2","mnutind_date":"2014-07-01"}],"water":"2","water_o":"","water_dist":20,"toil":"5","toil_o":"","tenur":"1","tenur_o":"","imprnt":600,"welec":"1","elec_company":"1","elec_generator":"2","elec_solar":"2","elec_battery":"2","elec_source_o":"2","elec_source_o_lb":"","radio":1,"radio_nwacq":0,"tv":0,"tv_nwacq":0,"vplayer":0,"vplayer_nwacq":0,"stereo":0,"stereo_nwacq":0,"karaoke":0,"karaoke_nwacq":0,"ref":0,"ref_nwacq":0,"efan":0,"efan_nwacq":0,"iron":0,"iron_nwacq":0,"stove":0,"stove_nwacq":0,"wmach":0,"wmach_nwacq":0,"microw":0,"microw_nwacq":0,"computer":0,"computer_nwacq":0,"internet":0,"internet_nwacq":0,"celfone":1,"celfone_nwacq":0,"telefone":0,"telefone_nwacq":0,"airc":0,"airc_nwacq":0,"sewmach":0,"sewmach_nwacq":0,"car":0,"car_nwacq":0,"motor":0,"motor_nwacq":0,"landagri":1,"landagri_nwacq":0,"landres":0,"landres_nwacq":0,"landcomm":0,"landcomm_nwacq":0,"sofa":0,"sofa_nwacq":0,"dineset":0,"dineset_nwacq":0,"own_other":0,"own_other_o":"","own_other_nwacq":0,"insur_house":"2","insur_house_src":"","insur_house_src_o":"","insur_motor":"2","insur_motor_src":"","insur_motor_src_o":"","insur_appliance":"2","insur_appliance_src":"","insur_appliance_src_o":"","garb_collect":"2","garb_burn":"1","garb_comp":"2","garb_recycl":"2","garb_wsegr":"2","garb_cpit":"2","garb_opit":"2","garb_river":"2","garb_mgt_o":"2","garb_mgt_o_lb":"","garb_collector":"","garb_collector_o":"","freq_garb_coll":"","freq_garb_coll_o":"","cropind":"1","cropincsh":2000,"cropinknd":1000,"poultind":"2","pouincsh":0,"pouinknd":0,"fishind":"2","fishincsh":0,"fishinknd":0,"forind":"2","forincsh":0,"forinknd":0,"salind":"2","salincsh":0,"salinknd":0,"manind":"2","manincsh":0,"maninknd":0,"servind":"2","servincsh":0,"servinknd":0,"trnind":"2","trnincsh":0,"trninknd":0,"minind":"2","minincsh":0,"mininknd":0,"cnsind":"2","cnsincsh":0,"cnsinknd":0,"eothind":"2","eoincsh":0,"eoinknd":0,"etotcsh":2000,"etotknd":1000,"wagcsh":136800,"wagknd":0,"agscsh":0,"agsknd":0,"ofwcsh":0,"ofwknd":0,"supfcsh":0,"supfknd":0,"suprcsh":0,"suprknd":0,"rentvcsh":0,"rentvknd":0,"intrcsh":0,"intrknd":0,"pencsh":0,"penknd":0,"divcsh":0,"divknd":0,"othscsh":0,"othsknd":0,"othstotcsh":0,"othstotknd":0,"imprnttot":7200,"totincsh":138800,"totinknd":8200,"totin":147000,"nalp":0,"hpq_alp":[],"ncrop":2,"hpq_crop":[{"crop_line":"1404302501354","croptype":"4","croptype_o":"SQUASH,EGGPLANT","crop_vol":3},{"crop_line":"1404302501355","croptype":"4","croptype_o":"KAMOTE,CASSAVA","crop_vol":5}],"agriequip1":"2","agriequip1_nown":0,"agriequip2":"1","agriequip2_nown":1,"agriequip3":"2","agriequip3_nown":0,"agriequip4":"2","agriequip4_nown":0,"agriequip5":"2","agriequip5_nown":0,"agriequip6":"2","agriequip6_nown":0,"agriequip7":"2","agriequip7_nown":0,"agriequip8":"2","agriequip8_nown":0,"agriequip9":"2","agriequip9_nown":0,"agriequip10":"2","agriequip10_nown":0,"agriequip11":"2","agriequip11_nown":0,"agriequip12":"2","agriequip12_nown":0,"agriequip13":"2","agriequip13_nown":0,"agriequip14":"2","agriequip14_nown":0,"agriequip15":"2","agriequip15_nown":0,"agriequip16":"2","agriequip16_nown":0,"agriequip17":"2","agriequip17_nown":0,"agriequip18":"2","agriequip18_nown":0,"agriequip18_o":"","live_a_hog":null,"live_a_hog_vol":0,"live_a_goat":null,"live_a_goat_vol":0,"live_a_carabao":null,"live_a_carabao_vol":0,"live_a_cow":null,"live_a_cow_vol":0,"live_a_chicken":null,"live_a_chicken_vol":0,"live_a_duck":null,"live_a_duck_vol":0,"live_a_others":null,"live_a_others_o":"","live_a_others_vol":0,"meat_hog":null,"meat_hog_vol":0,"meat_goat":null,"meat_goat_vol":0,"meat_carabao":null,"meat_carabao_vol":0,"meat_cow":null,"meat_cow_vol":0,"meat_chicken":null,"meat_chicken_vol":0,"meat_duck":null,"meat_duck_vol":0,"meat_others":null,"meat_others_o":"","meat_others_vol":0,"milk_goat":null,"milk_goat_vol":0,"milk_carabao":null,"milk_carabao_vol":0,"milk_cow":null,"milk_cow_vol":0,"milk_others":null,"milk_others_o":"","milk_others_vol":0,"egg_chicken":null,"egg_chicken_vol":0,"egg_duck":null,"egg_duck_vol":0,"egg_others":null,"egg_others_o":"","egg_others_vol":0,"oani_ind":null,"oani_txt":"","oani_hog":null,"oani_hog_vol":0,"oani_goat":null,"oani_goat_vol":0,"oani_carabao":null,"oani_carabao_vol":0,"oani_cow":null,"oani_cow_vol":0,"oani_chicken":null,"oani_chicken_vol":0,"oani_duck":null,"oani_duck_vol":0,"oani_others":null,"oani_others_o":"","oani_others_vol":0,"catch_fish":null,"cul_fish":null,"catch_fish_loc":null,"boat1":null,"boat1_own":null,"boat2":null,"boat2_own":null,"boat3":null,"boat3_own":null,"boat4":null,"boat4_own":null,"boat5":null,"boat5_own":null,"naquaequip":0,"hpq_aquaequip":[],"fishpond":null,"fishpen":null,"fishcage":null,"seaweedfarm":null,"oysterfarm":null,"musselfarm":null,"fishtank":null,"hatchery":null,"aquafarm_o":null,"aquafarm_o_txt":"","naquani":0,"hpq_aquani":[],"maxyr_resid":"1","yrs_in_cropind":"1","u_amt_harv":"1","u_low_harv":"2","u_low_harv_o_lb":"","u_chng_scrop":"2","u_chng_scrop_y":"","u_chng_scrop_y_o_lb":"","u_chng_pcrop":"2","u_chng_pcrop_y":"","u_chng_pcrop_y_o_lb":"","irfa_crop":"2","irfa_crop_src":"","irfa_crop_src_o":"","irfa_agriequip":"2","irfa_agriequip_src":"","irfa_agriequip_src_o":"","yrs_in_lstockind":null,"u_amt_lve":null,"u_low_lve":"","u_low_lve_o_lb":"","irfa_anim":null,"irfa_anim_src":"","irfa_anim_src_o":"","yrs_in_fishind":null,"u_amt_fish":null,"u_low_fish":"","u_low_fish_o_lb":"","irfa_fish":null,"irfa_fish_src":"","irfa_fish_src_o":"","temp_humid":"1","elec_loss":"1","sea_level":"4","water_supply":"3","low_wsupp":"","low_wsupp_o_lb":"","flood_freq":"3","flood_duration":0,"flood_duration_12":0,"drought":"1","drought_duration":"1","evac_mveout":"2","evac_ymveout":"","evac_ymveout_o":"","evac_trans":"1","evac_cntr":"4","evac_cntr_o_lb":"","calam1":"1","calam1_hwmny":1,"calam1_aid":"2","calam1_hus_aid":"","calam1_hus_aid_o":"","calam2":"2","calam2_hwmny":0,"calam2_aid":null,"calam2_hus_aid":"","calam2_hus_aid_o":"","calam3":"2","calam3_hwmny":0,"calam3_aid":null,"calam3_hus_aid":"","calam3_hus_aid_o":"","calam4":"2","calam4_hwmny":0,"calam4_aid":null,"calam4_hus_aid":"","calam4_hus_aid_o":"","calam5":"2","calam5_hwmny":0,"calam5_aid":null,"calam5_hus_aid":"","calam5_hus_aid_o":"","calam6":"2","calam6_hwmny":0,"calam6_aid":null,"calam6_hus_aid":"","calam6_hus_aid_o":"","calam7":"2","calam7_hwmny":0,"calam7_aid":null,"calam7_hus_aid":"","calam7_hus_aid_o":"","calam8":"2","calam8_hwmny":0,"calam8_aid":null,"calam8_hus_aid":"","calam8_hus_aid_o":"","calam9":"2","calam9_hwmny":0,"calam9_aid":null,"calam9_hus_aid":"","calam9_hus_aid_o":"","calam10":"2","calam10_hwmny":0,"calam10_aid":null,"calam10_hus_aid":"","calam10_hus_aid_o":"","calam11":"2","calam11_o":"","calam11_hwmny":0,"calam11_aid":null,"calam11_hus_aid":"","calam11_hus_aid_o":"","disas_prep":"2","dp_kit1":null,"dp_kit1_xpiry":0,"dp_kit2":null,"dp_kit2_xpiry":0,"dp_kit3":null,"dp_kit4":null,"dp_kit5":null,"dp_kit6":null,"dp_kit7":null,"dp_kit8":null,"dp_kit9":null,"dp_kit10":null,"dp_kit11":null,"dp_kit12":null,"dp_kit13":null,"dp_kit13_o":"","dp_kit13_xpiry":0,"fshort":"2","fsmonth_1":"","fsdays_1":0,"fsmonth_2":"","fsdays_2":0,"fsmonth_3":"","fsdays_3":0,"prevmind":"2","ndeath":0,"hpq_death":[],"prog_slp":"2","prog_slp_nmem":0,"hpq_slp_mem":[],"prog_slp_impl":"","prog_slp_impl_o":"","prog_fudforsch":"2","prog_fudforsch_nmem":0,"hpq_fudforsch_mem":[],"prog_fudforsch_impl":"","prog_fudforsch_impl_o":"","prog_fudforwrk":"2","prog_fudforwrk_nmem":0,"hpq_fudforwrk_mem":[],"prog_fudforwrk_impl":"","prog_fudforwrk_impl_o":"","prog_cshforwrk":"2","prog_cshforwrk_nmem":0,"hpq_cshforwrk_mem":[],"prog_cshforwrk_impl":"","prog_cshforwrk_impl_o":"","prog_spisc":"2","prog_spisc_nmem":0,"hpq_spisc_mem":[],"prog_spisc_impl":"","prog_spisc_impl_o":"","prog_cct":"2","prog_cct_nmem":0,"hpq_cct_mem":[],"prog_cct_impl":"","prog_cct_impl_o":"","prog_arcdp":"2","prog_arcdp_nmem":0,"hpq_arcdp_mem":[],"prog_arcdp_impl":"","prog_arcdp_impl_o":"","prog_cbep":"2","prog_cbep_nmem":0,"hpq_cbep_mem":[],"prog_cbep_impl":"","prog_cbep_impl_o":"","prog_phiheal_ofw":"2","prog_phiheal_ofw_nmem":0,"hpq_phiheal_ofw_mem":[],"prog_phiheal_empl":"2","prog_phiheal_empl_nmem":0,"hpq_phiheal_empl_mem":[],"prog_phiheal_indiv":"2","prog_phiheal_indiv_nmem":0,"hpq_phiheal_indiv_mem":[],"prog_phiheal_spon":"2","prog_phiheal_spon_nmem":0,"hpq_phiheal_spon_mem":[],"prog_phiheal_spon_impl":"","prog_phiheal_spon_impl_o":"","prog_phiheal_life":"2","prog_phiheal_life_nmem":0,"hpq_phiheal_life_mem":[],"nprog":1,"hpq_prog":[{"prog_line":"1404302501357","progtype":"22","progname":"POVERTY ALLEVIATION PROGRAM","prognmem":1,"hpq_prog_mem":[{"hpq_prog_mem_refno":"1404302501330"}],"progimplementor":"3","progimplementor_o":""}],"end_time":"12:54","supervisor":"MARY GRACE CASAUL"}

我的代码就是这个..(我刚从这个网站的答案中得到了这个,但它只读取了“hpq_mem”之后的数据,我想要做的是读取所有数据并将其放到一个表中,标头是我的JSON数据中的变量..

Imports System.Web.Script.Serialization
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Newtonsoft.Json.Serialization

Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim json As String = TextBox1.Text
    Dim jss = New JavaScriptSerializer()
    Dim data = jss.Deserialize(Of Object)(json)
    Dim sb As New StringBuilder()
    sb.Append("<table>" & vbLf & "<thead>" & vbLf & "<tr>" & vbLf)
    For Each key As String In data("hpq_mem")(0).Keys
        sb.AppendFormat("<th>{0}</th>" & vbLf, key)
    Next
    sb.Append("</tr>" & vbLf & "</thead>" & vbLf & "<tbody>" & vbLf)
    For Each item As Dictionary(Of String, Object) In data("hpq_mem")
        sb.Append("<tr>" & vbLf)
        For Each val As String In item.Values
            sb.AppendFormat("      <td>{0}</td>" & vbLf, val)
        Next
    Next
         sb.Append("</tr>" & vbLf & "</tbody>" & vbLf & "</table>")
         Dim myTable As String = sb.ToString()
         WebBrowser1.DocumentText = myTable
    End Sub
End Class

1 个答案:

答案 0 :(得分:0)

尝试以下代码。这假设您只需要来自hpq_mem属性的数据。

Imports System.Text
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim myJsonObject = JsonConvert.DeserializeObject(Of Object)(TextBox1.Text)

    Dim sb As New StringBuilder()
    sb.Append("<table>" & vbLf & "<thead>" & vbLf & "<tr>" & vbLf)

    Dim firstIterate = True
    For Each hpqMemObject As JObject In myJsonObject("hpq_mem")
        If firstIterate Then
            For Each keyPair As KeyValuePair(Of String, JToken) In hpqMemObject
                sb.AppendFormat("<th>{0}</th>" & vbLf, keyPair.Key)
            Next
            sb.Append("</tr>" & vbLf & "</thead>" & vbLf & "<tbody>" & vbLf)
            firstIterate = False
        End If
        sb.Append("<tr>" & vbLf)
        For Each keyPair As KeyValuePair(Of String, JToken) In hpqMemObject
            sb.AppendFormat("<td>{0}</td>" & vbLf, keyPair.Value)
        Next
    Next
    sb.Append("</tr>" & vbLf & "</tbody>" & vbLf & "</table>")

    WebBrowser1.DocumentText = sb.ToString()
End Sub