Vb.net 在文本框中运行脚本
问题描述:
我想知道是否有办法执行 Textbox1 中的脚本就像你在 textbox1 中编写这段代码
I was wondering if there is a way to excute a Script that is in Textbox1 Like you write this code inside textbox1
msgbox("Hello World")
当您单击按钮或按 Enter 键时,它将运行您在 Textbox1 中编写的命令/脚本
and when you click on the button or press enter it will run the command/script you wrote in Textbox1
答
您正在寻找 CodeDOM.这基本上可以让您从程序中运行编译器.请注意,用户可以在框中输入任何内容并用它来破坏您的程序.
You're looking for CodeDOM. This basically lets you run the compiler from within your program. Be careful, the user could type anything into the box and compromise your program with it.