我的申请网址:public static object Eval(string booleanExpression) {
var c = new Microsoft.CSharp.CSharpCodeProvider();
var icc = c.CreateCompiler();
var cp = new System.CodeDom.Compiler.CompilerParameters();
cp.CompilerOptions = "/t:library";
cp.GenerateInMemory = true;
StringBuilder sb = new StringBuilder("");
sb.Append("using System;\n" );
sb.Append("namespace BooleanEvaluator{ \n");
sb.Append("public class BooleanEvaluator{ \n");
sb.Append("public bool Evaluate(){\n");
sb.Append("return "+booleanExpression+"; \n");
sb.Append("} \n");
sb.Append("} \n");
sb.Append("}\n");
var cr = icc.CompileAssemblyFromSource(cp, sb.ToString());
System.Reflection.Assembly a = cr.CompiledAssembly;
object o = a.CreateInstance("BooleanEvaluator.BooleanEvaluator");
Type t = o.GetType();
MethodInfo mi = t.GetMethod("Evaluate");
return (bool) mi.Invoke(o, null);
}
我的Ajax代码:
http://localhost/ctsubagent/
当我点击按钮运行ajax时,在consolle中存在如下错误:
...
$.ajax({
url: base_url + 'hotel_booking/hotel/search_hotel',
type: "post",
...
404 Not Found
它似乎没有调用ctsubagent,但它正在调用subagent。这导致错误。
似乎应该在配置中设置。但是我不知道。我试过了,但没有成功。
任何帮助非常感谢
干杯