目前我正在使用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