开发者

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

开发者 https://www.devze.com 2023-02-13 23:37 出处:网络
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#

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

精彩评论

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