var jsonMPath = "modules\\json.lua".GetDLLRunDir();
            if (!File.Exists(jsonMPath)) throw new Exception($"modules\\json.lua 不存在!");
            Script script = new Script();
            var dv = script.DoFile(jsonMPath);
            script.Globals["json"] = dv;
            var scriptCode = $@"
t=json.encode({{1,2,3}});
return t
";
            DynValue res = script.DoString(scriptCode);
原文:https://www.cnblogs.com/huawublog/p/13362578.html