On 9 May 2007 08:32:25 -0700,
je*@auto-soft.co.za wrote:
>I want to enter code in a textbox and then be able to execute that
code.How can i convert the text in the textbox to code that can be
executed?
1 Write the text to a .cs file.
2 Call the C# compiler with the command line interface to compile the
..cs file
3 If the compile succeeded then run the .exe file the compiler
created.
To call another program from within a C# program use something like:
using (Process proc = Process.Start("progname.exe",
"prog parameters"))
{
proc.WaitForExit();
if(proc.ExitCode != 0) throw new Exception();
}
The Process class is in System.Diagnostics.
rossum