我想执行以字符串形式传递给我的函数的代码,该代码将在运行时传递.这是一个示例代码,可以作为字符串传递给我的函数.
I want to execute the code that is passed as a string to my function, the code will be passed at runtime. This is an example code that may be passed as a string to my function.
p是一个数据集,已声明并具有一些值,此代码在asp页中执行
p is a dataset, which is declared and has some values, this code is executed in a asp page
p.Tables(0).Rows(0)("disp_status") = "Approved by CEO"; p.Tables(0).Rows(0)("status") = "Approved"; Session("fnc") = "generate po"; Session("rec_id") = p.Tables(0).Rows(0)("IndexID"); Session("ord_ref")="PR No."; Server.Execute("../rlm/mne_pr_form_f.asp"); p.Tables(0).Rows(0)("status") = "Order Raised" p.Tables(0).Rows(0)("disp_status") = "Order Raised" p.Tables(0).Rows(0)("lock_record") = "Yes"; Session("fnc") = ""; Session("rec_id") = "";推荐答案
没有这样的Eval函数,但是根据您要执行的操作,您可以使用Reflection做类似的事情,这是CodeProject的文章其中包含一个可让您执行此操作的库:运行时编译(.NET eval语句)
There's no Eval function as such, but depending on exactly what you want to do, you can do things like this using Reflection and here is a CodeProject article that includes a library to let you do this: Runtime Compilation (A .NET eval statement)
更多推荐
vbscript eval是否有等效的vb.net eval函数
发布评论