初始化
This commit is contained in:
28
BooliveMQTT_Auth/Common/StaticData.cs
Normal file
28
BooliveMQTT_Auth/Common/StaticData.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Reflection;
|
||||
using IronPython.Hosting;
|
||||
using Microsoft.Scripting.Hosting;
|
||||
|
||||
namespace IotManager.Common
|
||||
{
|
||||
public class StaticData
|
||||
{
|
||||
public static ScriptEngine eng = Python.CreateEngine();
|
||||
public static ScriptScope scope1 = eng.CreateScope();
|
||||
public static ScriptScope scope2 = eng.CreateScope();
|
||||
public static ScriptScope scope3 = eng.CreateScope();
|
||||
|
||||
public static void GetWebAPIMethod()
|
||||
{
|
||||
eng.Runtime.LoadAssembly(Assembly.GetExecutingAssembly());
|
||||
eng.ExecuteFile("script\\webapi.py", scope1);
|
||||
}
|
||||
public static void GetWebAPIMethod1()
|
||||
{
|
||||
eng.ExecuteFile("script\\CommonData.py", scope2);
|
||||
}
|
||||
public static void GetWebAPIMethod2()
|
||||
{
|
||||
eng.ExecuteFile("script\\b.py", scope1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user