Closing a process

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2009
Posts: 2
Reputation: Owbon is an unknown quantity at this point 
Solved Threads: 0
Owbon Owbon is offline Offline
Newbie Poster

Re: open exe file using c#

 
0
  #1
Aug 14th, 2009
How would i close the file then ... I am writing a program to run different powerpoint show depending on the time of day. I want to be able to close 1.pps when its time for 2.pps to run. hope this makes sense!


  1. if (time.Hour >= 9 && time.Hour < 12)
  2. {
  3. Process.Start(@"C:\1.pps");
  4.  
  5. }
  6.  
  7. else if (time.Hour >= 12 && time.Hour < 15)
  8. {
  9. Process.Start(@"C:\2.pps");

The idea is to wrap a for loop around the if statment and get it to keep checking what the time is and run the correct pps
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 103
Reputation: mariocatch is an unknown quantity at this point 
Solved Threads: 17
mariocatch mariocatch is offline Offline
Junior Poster

Re: open exe file using c#

 
0
  #2
Aug 14th, 2009
  1. System.Diagnostics.Process proc = new System.Diagnostics.Process();
  2.  
  3. proc.StartInfo = new System.Diagnostics.ProcessStartInfo("asdf.exe");
  4.  
  5. proc.Start();
  6. proc.Close();
Last edited by mariocatch; Aug 14th, 2009 at 11:27 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 2
Reputation: Owbon is an unknown quantity at this point 
Solved Threads: 0
Owbon Owbon is offline Offline
Newbie Poster

Re: open exe file using c#

 
0
  #3
Aug 14th, 2009
Thanks alot!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 299 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC