My exe code like this:
class Program
{
//here I want to call
static int ADD(int a , int b){return a+b};
static void Main(string[] args)
{
}
}
My other project call exe by Progress like :
Process p = new Process();
p.StartInfo.Arguments = sb.ToString();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "Myexe.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p.EnableRaisingEvents = true;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.Start();
I knew I can set args[] to do something , But how can I invoke some method & return value ,
for example "ADD(1+1)"
Maybe it can send message back or get output? , I don't know.