回答編集履歴
1
追記
test
CHANGED
@@ -49,3 +49,167 @@
|
|
49
49
|
}
|
50
50
|
|
51
51
|
```
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
**【追伸】**
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
上のコードは C# で検証したコードを以下の変換サービスで VB.NET のコードに変換したもので、VB.NET のプロジェクトでは検証してませんので、もし間違いがあったらスミマセン。
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
Telerik Code COnverter
|
64
|
+
|
65
|
+
[https://converter.telerik.com/](https://converter.telerik.com/)
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
参考までに、C# のコードを以下に記載しておきます。
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
```
|
76
|
+
|
77
|
+
using System;
|
78
|
+
|
79
|
+
using System.Collections.Generic;
|
80
|
+
|
81
|
+
using Newtonsoft.Json;
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
namespace ConsoleAppJson2
|
86
|
+
|
87
|
+
{
|
88
|
+
|
89
|
+
class Program
|
90
|
+
|
91
|
+
{
|
92
|
+
|
93
|
+
static void Main(string[] args)
|
94
|
+
|
95
|
+
{
|
96
|
+
|
97
|
+
var jsonInfo = new JsonInfo
|
98
|
+
|
99
|
+
{
|
100
|
+
|
101
|
+
Carlist = new Carlist
|
102
|
+
|
103
|
+
{
|
104
|
+
|
105
|
+
maker = "TOYOTA",
|
106
|
+
|
107
|
+
shasyu = new List<Shasyu>
|
108
|
+
|
109
|
+
{
|
110
|
+
|
111
|
+
new Shasyu
|
112
|
+
|
113
|
+
{
|
114
|
+
|
115
|
+
shasyunm = "Prius",
|
116
|
+
|
117
|
+
katasiki = new List<Katasiki>
|
118
|
+
|
119
|
+
{
|
120
|
+
|
121
|
+
new Katasiki { katamei = "6AA-ZVW51"},
|
122
|
+
|
123
|
+
new Katasiki { katamei = "DAA-ZVW55"}
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
},
|
128
|
+
|
129
|
+
new Shasyu
|
130
|
+
|
131
|
+
{
|
132
|
+
|
133
|
+
shasyunm = "Yaris",
|
134
|
+
|
135
|
+
katasiki = new List<Katasiki>()
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
};
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
var jsonString = JsonConvert.SerializeObject(jsonInfo, Formatting.Indented);
|
148
|
+
|
149
|
+
Console.WriteLine(jsonString);
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
public class JsonInfo
|
162
|
+
|
163
|
+
{
|
164
|
+
|
165
|
+
public Carlist Carlist { get; set; }
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
public class Carlist
|
172
|
+
|
173
|
+
{
|
174
|
+
|
175
|
+
public string maker { get; set; }
|
176
|
+
|
177
|
+
public List<Shasyu> shasyu { get; set; }
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
public class Shasyu
|
184
|
+
|
185
|
+
{
|
186
|
+
|
187
|
+
public string shasyunm { get; set; }
|
188
|
+
|
189
|
+
public List<Katasiki> katasiki { get; set; }
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
public class Katasiki
|
196
|
+
|
197
|
+
{
|
198
|
+
|
199
|
+
public string katamei { get; set; }
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
```
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
結果は:
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
![イメージ説明](1d0d6157c7e181cc0be797515ecbd48a.jpeg)
|