this.msc.Language = language.ToString(); ((DScriptControlSource_Event)this.msc).Error += new DScriptControlSource_ErrorEventHandler(ScriptEngine_Error); ((DScriptControlSource_Event)this.msc).Timeout += new DScriptControlSource_TimeoutEventHandler(ScriptEngine_Timeout); } /// <summary> /// 运行Eval方法 /// </summary> /// <param name="expression">表达式</param> /// <param name="codeBody">函数体</param> /// <returns>返回值object</returns> public object Eval(string expression,string codeBody) { msc.AddCode(codeBody); return msc.Eval(expression); } /// <summary> /// 运行Eval方法 /// </summary> /// <param name="language">脚本语言</param> /// <param name="expression">表达式</param> /// <param name="codeBody">函数体</param> /// <returns>返回值object</returns> public object Eval(ScriptLanguage language,string expression,string codeBody) { if(this.Language != language) this.Language = language; return Eval(expression,codeBody); } /// <summary> /// 运行Run方法
|
正在阅读:在C#中调用VBScript等脚本的实现在C#中调用VBScript等脚本的实现
2004-05-13 10:23
出处:PConline
责任编辑:linjixiong
键盘也能翻页,试试“← →”键