0

josnオブジェクトをxmlDocumetに変換しました。vbを使用してabc.xmlのようなコンピューターにこのxmlDocumetを保存したいです。助けてください。ファイルが非常に大きいため、個々のタグを読み取ることができません。n親切に助けてください。

Private Function JsonToX() As XDocument
    Dim xmlDoc As XDocument
    Dim EventId As String
    EventId = GetEventID()
    Dim httpWebRequest As HttpWebRequest = WebRequest.Create(url)
    httpWebRequest.Method = WebRequestMethods.Http.Get
    httpWebRequest.Accept = "application/json"
    Dim response As HttpWebResponse
    response = httpWebRequest.GetResponse()
    Dim ResponseStream As Stream = response.GetResponseStream()
    Dim StreamReader As New StreamReader(ResponseStream)
    Dim Text As String = StreamReader.ReadToEnd()
    'because the origional JSON string has multiple root's this needs to be added
    Dim jsonhtml As String = "{BFBC2_GlobalStats:"
    jsonhtml += Text + "}"
    xmlDoc = JsonConvert.DeserializeXNode(jsonhtml)
    ' want to save xmldoc in a file  xmlDoc.Save("abc.xml") not working
    Return xmlDoc
End Function
4

0 に答える 0