برای راحتی در برنامه پیوست responsetext رو در یک فایل به اسم a.json ریختم و از اونجا میخونم، بالطبع شما همون رو مستقیم استفاده میکنین:
Option Compare Database
Option Explicit
Public Type IrcProductInfoState
isCovered As Boolean
isSpecialDisease As Boolean
shape As String
End Type
Public Type IrcProductInfo
id As Integer
isDefault As Boolean
fullName As String
shortName As String
nationalNumber As String
interfaceName As String
description As String
basePrice As Long
state As IrcProductInfoState
End Type
Sub readfile()
Dim fso As New FileSystemObject
Dim T As TextStream
Set T = fso.OpenTextFile(CurrentProject.Path & "\a.json", ForReading)
Dim S As String
S = T.ReadAll
T.Close
Set T = Nothing
Set fso = Nothing
Dim R As Object
Set R = ParseJson(S)
Dim resCode As Long
Dim resMessage As String
resCode = R("resCode")
resMessage = R("resMessage")
Dim infos() As IrcProductInfo
ReDim infos(1 To R("info").Count)
Dim x As Object
Dim i As Integer
For i = 1 To R("info").Count
Set x = R("info")(i)
With infos(i)
.id = x("id")
.isDefault = x("isDefault")
.fullName = x("fullName")
.shortName = x("shortName")
.nationalNumber = x("nationalNumber")
.interfaceName = x("interfaceName")
.description = x("description")
.basePrice = x("basePrice")
.state.isCovered = x("state")("isCovered")
.state.isSpecialDisease = x("state")("isSpecialDisease")
.state.shape = x("state")("shape")
End With
Next i
End Sub





پاسخ با نقل قول