在网上看到不少VB.NET中实现脚本引擎的例子,本人现在正在做ASP.NET的开发,要实现类似的功能.
如:
在页面中放一个TextBox(多行),允许用户输入一段VB或C#的代码,用户按"确定"之后就编译并执行该段代码.请问如何实现?!
急!!!过两天就要交货了!!!!呜!!!
如:
在页面中放一个TextBox(多行),允许用户输入一段VB或C#的代码,用户按"确定"之后就编译并执行该段代码.请问如何实现?!
急!!!过两天就要交货了!!!!呜!!!
解决方案 »
- .aspx网页 右键在浏览器中查看,看不见我写的内容,必须刷新下才行,为什么
- 数据导出问题
- 把gridview和details关联起来?
- 关于GridView绑定时特殊字符
- FCKeditor怎么引入样式
- 求c/s 下普通treeview增删改查方法
- [求助]快帮帮我拉!!!!!
- 谁能解决以下水晶报表的问题,1000分相送!!我相信这些问题好多人遇到,请帮我顶!!!
- 用window.open打开的窗体怎样才能实现最大化,是真正的最大化,不是resize to那种,使鼠标按住标头栏不能再托动窗体了。
- 请教一个关于自定义控件问题,很急!!!
- 看过duwamish7的进来看下啊
- 高分询问:像这个网站是用什么技术做的?
//从CompileCoder继承一个代码编译器如:
public class CompileCoder
{
public static CompilerResults CompileCode(CodeDomProvider provider, string fileName)
{
ICodeCompiler compiler = provider.CreateCompiler();
CompilerParameters cp = new CompilerParameters(new string[] {
"System.dll",
"System.Drawing.dll"
}, filepath.LastIndexOf(".")+1)+"dll", false);
cp.GenerateExecutable = false;
//cp.CompilerOptions="/resource:AppResource.resources";资源文件名字
string[] fileBatch=new string[1];
fileBatch[0]=filepath;
CompilerResults cr = compiler.CompileAssemblyFromFileBatch(cp, fileBatch);
return cr;
}
}
//使用这个编译器
string sCompileMessage = null;
CodeDomProvider provider = new CSharpCodeProvider( );
CompilerResults cr = CompileCoder.CompileCode( provider, "AppResource.cs" );
if( cr.Errors.Count > 0 )
{
foreach( CompilerError ce in cr.Errors )
sCompileMessage += ce.ToString( ) + "\r\n";
}
else
{
sCompileMessage = cr.PathToAssembly + " 已生成文件.";
}