On Fri, 10 Aug 2007 22:38:00 -0700, ydbn
<yd**@discussions.microsoft.comwrote:
>What's the best easy way to have a function/method:
1. Has a string paramter, the value of string is C#/VB.Net express.
2. The function evaluate the express and return the value.
I don't know if this is the best/easiest way, but it is a way.
The parameter string has to be a complete compilable program, or at
least something that can be turned into a complete program easily.
1 If needed turn the parameter string into a string containing a
complete program.
2 Save the complete program string to a file.
3 Invoke the C# compiler to compile the program file into an exe file.
4 Invoke the newly created exe file.
5 Retrieve and return the result.
rossum