Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have Two (First,Second) C# Windows application in same solution ,I launch second application from first but i need two pass parameter when launch second application from
First.

What I have tried:

//First Project
//do this code when the first project run 
Thread thread = new Thread(new ThreadStart(launchSecond));
            thread.Start();

private void launchSecond()
        {
            bool stop = false;
            while (!stop)
            {
                if (DateTime.Now >= fireDate)
                {
                    //SecondPaththe path of second project second.exe
                    Process.Start(SecondPath);
                    stop = true;
                }
                else
                    Thread.Sleep(1);
            }
        }

//how send parameter and how receive it in second project
//Above code worked success.
Posted
Updated 1-Mar-18 1:42am

 
Share this answer
 
If you have two different processes (as your question suggests) then might use the well documented Process.Start Method (ProcessStartInfo) (System.Diagnostics)[^].
On the other hand if you just have two different threads in the same application (as your code suggests then have to use one of the available .NET threading classes, again, well documented (you may also find many code sample on the web)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900