Hi. I have made a windows form app to record scores for my friends when each person has a race on my race simulator.As it is now i manually put in the scores for finishing place. What i would like to do is have the app do it automatically by reading a json file that is created by the sim at the end of the race.I can read the whole file into a textbox text field and have been trying to work out the code to read data from the string using newtonsoft but the more example i look at the more confused I seem to get. The json file is below the part i after is the race result which is i may be wrong is an array within an array? i have special pasted the json as json properties
JSON:
{
"track":"townsville_reworked",
"number_of_sessions":1,
"players":[
{
"name":"Player",
"car":"supercars_holden_zb",
"skin":"daynight2020_huggins"
},
{
"name":"David Reynolds",
"car":"supercars_holden_zb",
"skin":"2020_009_r01"
},
{
"name":"Andre Heimgartner",
"car":"supercars_holden_zb",
"skin":"2022_008_r01"
},
{
"name":"Scott Pye",
"car":"supercars_holden_zb",
"skin":"2022_020_r01"
},
{
"name":"Shane VanGisbergen",
"car":"supercars_holden_zb",
"skin":"2020_097_r01"
},
{
"name":"Chris Pither",
"car":"supercars_holden_zb",
"skin":"2022_022_r01"
}
],
"sessions":[
{
"event":0,
"name":"Quick Race",
"type":3,
"lapsCount":5,
"duration":0,
"laps":[
],
"lapstotal":[
0,
0,
0,
0,
0,
0
],
"bestLaps":[
],
"raceResult":[
1,
2,
3,
4,
5,
0
]
}
],
"extras":[
{
"name":"bestlap",
"time":0
}
]
}
Last edited by a moderator: