开发者

eval php or asp code with c#, is possible?

hello I am writing a c# comand line application which interacts with mysql db. I read some text on the db that may be php code or asp code. Is there any way to eval or interpretate this code inside c#? Ex:

st开发者_如何转开发atic void Main(string[] args)
{
   String phpcode="$test='THIS IS A TEST';return $test";
   String res=EVAL(phpcode);//or aspcode or some other not compiled language
   Console.WriteLine(res);
   //res="THIS IS A TEST";
}


In general, no.

However, most languages have interpreters available.

For example, you can run PHP.exe using Process.Start.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜