从code文件执行C#code运行时 [英] execute c# code at runtime from code file
本文介绍了从code文件执行C#code运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 WPF C#应用程序包含一个按钮。
I have a WPF C# application that contains a button.
的按钮,单击code被写入其中将放置在应用程序运行时目录单独的文本文件。
The code of the button click is written in separate text file which will be placed in the applications runtime directory.
我要的的执行的的code放置在文本文件上按一下按钮。
I want to execute that code placed in the text file on the click of the button.
不知道如何做到这一点?
Any idea how to do this?
推荐答案
您可以使用<一个href="http://msdn.microsoft.com/en-us/library/microsoft.csharp.csharp$c$cprovider.aspx"><$c$c>Microsoft.CSharp.CSharp$c$cProvider$c$c>编译code上的动态。尤其是看到<一href="http://msdn.microsoft.com/en-us/library/system.$c$cdom.compiler.$c$cdomprovider.compileassemblyfromfile.aspx">CompileAssemblyFromFile.
这篇关于从code文件执行C#code运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文