Guest User

Untitled

a guest
Jan 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment