[vb.net] JSON 기본 정리 > vb.net

본문 바로가기

vb.net

[기타] [vb.net] JSON 기본 정리

회원사진
하나를하더라도최선을
2021-02-08 17:17 6,711 0

본문



Imports Newtonsoft.Json
 
Dim Result as String = [JSON_문자열]
Dim tmpJson as JObject = JObject.Parse(Result)
Dim tmp as String = tmpJson([key])
 
반대로 
 
Dim tmpJson As New JObject()
With tmpJson
    .Add("A", A_Value)
    .Add("B", B_value)
End With
Dim tmp as String = tmpJson.ToString() 
 
 
아래와 같은 방법을 활용할 수 있습니다.
 
Dim json As Object
json = New With {Key .key1 = "value1", .key2 = "value2"}
MsgBox(json.ToString)
 
Dim json As Object
json = New With {Key .list = {"foo""bar"}}
MsgBox(JsonConvert.SerializeObject(json))


476f3d6e1828f4ea5f6ac467b863240d_1612772328_1492.png
 

댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색