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
.
精彩评论