Hello guys, I already have a project created and consolidated, and I'm creating another project. I need to call the second project from the first one, passing a parameter, and the actions I do in the second project must be passed on to the first one.
Example. Project A calls Project B... waits for the user to close B, and whatever the user enters into B's textbox, it will return to project A.
private void button1_Click(object sender, EventArgs e) { string cPath = @"C:\Users\test"; string filename = Path.Combine(cPath, "WinFormsApp3.exe"); var proc = System.Diagnostics.Process.Start(filename, textBox1.Text, null, null, null); proc.CloseMainWindow(); proc.Close(); }
static void Main(string test) { if (string.IsNullOrWhiteSpace(test)) { string arg1 = test; Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Project2(arg1)); } else { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Project2()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)