SHARE
TWEET

Untitled

a guest Jan 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. override OnStartUp()
  2.  
  3.     {
  4.            if(condition == true)
  5.            {
  6.                 ProcessStartInfo p = new ProcessStartInfo("filePath");
  7.                 p.Start(); // This should wait for like say 5 seconds and then start.
  8.                   return;   // This will exit the current program.
  9.             }
  10.     }
  11.    
  12. public class MyThread
  13. {
  14.    public static void DoIt()
  15.    {
  16.       Thread.Sleep(100);
  17.       // DO what you need here
  18.    }
  19. }
  20. override OnStartUp()
  21. {
  22.     if(condition == true)
  23.     {
  24.        ThreadStart myThread = new MyThread(wt.DoIt);
  25.        Thread myThread = new Thread(myThread);
  26.        myThread.Start();
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top