目前我正在使用VB.Net。 我建立我的字符串,發佈出來,然後解析結果。在Json中解析不使用XML。 VB.Net
解析示例XML
Dim xml As New MWXMLDocument()
Dim sReason As String = "Unknown"
Try
xml.LoadXml(sresult)
If xml.SelectSimpleNode("AcceptedLead").InnerText = "true" Then
app.Outcome.RedirectURL = xml.SelectSimpleNode("result/redirecturl").InnerText
AcceptLead()
Return True
End If
sReason = xml.SelectSimpleNode("Reason").InnerText
Catch ex As Exception
sReason = "Error: " & ex.Message
End Try
DeclineLead(sReason)
Return False
End Function
我將如何解析發送回JSON的結果,這裏是我想用VB來解析結果的一個例子:我不能只是得到的數據字符串和解析爲正常的XML。
{"RedirectUrl":"www.test.com","Commission":5.0000,"Status":"accepted"}
的可能重複[如何解析在C#JSON?](http://stackoverflow.com/questions/6620165/how-to-parse-json-in-c) – Neolisk 2014-09-12 12:49:12
同時關注[System.Runtime.Serialization.Json](http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json(v = vs.110).aspx)。 – Neolisk 2014-09-12 12:49:49