المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Redirect Console for In-Memory Execution



C# Programming
09-08-2009, 03:51 PM
Hi,

I am developing a scripting tool in which I want to compile and execute the code in MEMORY, not as an executable file. But in there I need to redirect the console output to a Richtextbox and input to a simple textbox.

Example:

The script code is like this


public class Script
{
public static void Main()
{
Console.WriteLine("Hello World");
Console.ReadKey();
}
}


When I compile and execute in memory I want to print "Hello World" in a richtextbox and input the key from a textbox to terminate the application.

How can I accomplish it? I know how to redirect input/output if it is an executable file, but I don't know how to do the same for in-memory execution. Can anyone please help me?

Anindya Chatterjee
--------------------------------------------------------
1. Don't Visit .. (http://www.co.cc/?id=139190)[^ (http://www.co.cc/?id=139190)]

2. But Watch .. (http://rapidmovieshare.blogspot.com)