Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://api.money.126.net/data/feed/500018,money.api")
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
Dim stm As System.IO.Stream = rsps.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim json As String = reader.ReadToEnd
Dim idx As Integer = json.IndexOf("{")
Dim lidx As Integer = json.LastIndexOf("}")
json = json.SubString(idx+1, lidx-idx-1)
idx = json.IndexOf("{")
json = json.SubString(idx)
msgbox(json)
Dim ScriptControl As Object, data As Object, JscriptCode As String
JscriptCode = "function toObject(json) {eval(""var o=""+json);return o;}"
ScriptControl = CreateObject("MSScriptControl.ScriptControl")
With ScriptControl
.Language = "Javascript"
.Timeout = -1
.AddCode(JscriptCode)
data = .Run("toObject", json)
End With
msgbox(data.sname)
msgbox(data.name)