From 41975484fb14cafe27e6abfc0299aae90d254ee9 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 31 Jan 2016 20:37:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96Json=E5=B7=A5=E5=85=B7...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- JsonUtils.bas | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/JsonUtils.bas b/JsonUtils.bas index 98257d0..e49a4c5 100644 --- a/JsonUtils.bas +++ b/JsonUtils.bas @@ -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