(probably a dumb question)
// Program_1.exe:
int num = 1;
using (Process process = new Process())
{
process.StartInfo.FileName = "Program_2.exe";
if (process.Start())
{
process.WaitForExit();
}
}
Console.WriteLine(开发者_JS百科num.ToString()); // num should now equal 2
Psuedocode
// Program_2.exe:
// I want this program to change the value of a variable in Program_1.exe
Program_1.exe->num = 2;
Is this possible?
If so, how can I do it?
You need to use some form of inter-process communication, such as WCF.
精彩评论