lua和c#交互备注 : LuaInteractface 试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)

https://www.cnblogs.com/sundajade/articles/3735663.html

参考以上链接。

设置vs的目标平台为x86即可。

基本的lua和c#交互:

https://blog.csdn.net/qq_26413641/article/details/54575210

Lua Dostring返回object[] 输出是Double类型,如输出int需要转换下。

 static void Main(string[] args)
        {
            Lua test = new Lua();
            test["a"] = 1;
            object[] v = test.DoString("return 1");
            foreach(object item in v)
            {
                Console.WriteLine(Convert.ChangeType(item, typeof(int)));
                Console.WriteLine(item.GetType());
            }
        }

猜你喜欢

转载自www.cnblogs.com/sun-shadow/p/12218800.html