开发者

Debugging executed CodeDom?

I am using codedom to execute some code. Is it possible to stop somehow the execution? here is how i run the code:

Dim SourceCode as String="... some VB code"
Dim MyProvider As New VBCodeProvider
Dim cp As New CompilerParameters
Dim cr As CompilerResults = MyProvider.Comp开发者_如何学JAVAileAssemblyFromSource(cp, SourceCode)
Dim methInfo As MethodInfo = cr.CompiledAssembly.GetType("Class1").GetMethod("Main")
methInfo.Invoke(Nothing, Nothing)

my idea is to put this in a threadworker and if I need to stop it, i stop the thread... but is there a better solution maybe? Thanks :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜