public static CompilerResults Compile(string program)
{
CompilerResults compilerResults = null;
using (CSharpCodeProvider provider = new CSharpCodeProvider())
{
compilerResults = provider.CompileAssemblyFromSource(new CompilerParameters(new string[]
{
"System.dll"
}),
new string[] { program });
}
return compilerResults;
}