请问NET框架有任何类,允许你运行(编译除preT或其他)外部脚本文件中包含C#code?
Does the .NET framework have any classes which allow you to run (compile, interpret or whatever) an external script file containing C# code?
举例来说,如果我有一个文件 hello.cs中
包含这样的:
For instance, if I have a file Hello.cs
containing this:
class Hello
//This program displays Hello World
{
static public void Main()
{
System.Console.WriteLine("Hello World");
}
}
我怎样才能加载code以上,从一个WinForm的,应用程序,并执行它?
how can i load the code above, from within a winform, app and execute it?
我感兴趣的负载/执行逻辑;该程序可以是任何东西,从一个控制台应用程序到另一个winform应用程序。
I'm interested in the load/execute logic; the program could be anything, from a console app to another winform app.
反思是否允许这样?
看看下面的文章:的 C#:写上使用即时编译扩展的应用程序
Check out the following article: C#: Writing extendable applications using on-the-fly compilation.
上一篇:如何让Android客户端连接到服务器甚至在活动的变化,将数据发送到服务器?服务器、发送到、连接到、客户端
下一篇:putExtra树形返回HashMap中不能被转换为TreeMap的机器人转换为、机器人、putExtra、HashMap