0

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:

static 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";
}
2
  • I'd personally be interesting in why you're doing this? What problem are you trying to solve? Commented Mar 1, 2011 at 16:20
  • I have c# apps(tasks) that runs once a day that must do the same things that my web apps do, read database and eval some code. It's a little complex to explain here all. Commented Mar 1, 2011 at 16:27

1 Answer 1

1

In general, no.

However, most languages have interpreters available.

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

Sign up to request clarification or add additional context in comments.

1 Comment

It that what I was thinking as last solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.