1
0
mirror of https://e.coding.net/circlecloud/VBFunctionBas.git synced 2024-12-27 07:58:48 +00:00

简化Json工具...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2016-01-31 20:37:14 +08:00
parent b4d8728830
commit 41975484fb

View File

@ -4,18 +4,13 @@ Option Explicit
Public Function CreateJson(JsonFile As String) As Object
Dim JsonLine As String
Dim S As String
Dim js
Open JsonFile For Input As 1
Do Until EOF(1)
Line Input #1, S
JsonLine = JsonLine & S
Loop
Close #1
Set js = CreateObject("ScriptControl")
js.Language = "JScript"
js.AddCode "function j(s) { return eval('(' + s + ')'); }"
Set CreateJson = js.Run("j", JsonLine)
Set js = Nothing
Set CreateJson = StrToJson(JsonLine)
End Function
Public Function StrToJson(ByVal jsonstring As String) As Object