943,694 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 430
  • C# RSS
Aug 14th, 2009
0

Re: open exe file using c#

Expand Post »
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!


C# Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Owbon is offline Offline
2 posts
since Aug 2009
Aug 14th, 2009
0

Re: open exe file using c#

c# Syntax (Toggle Plain Text)
  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.
Reputation Points: 11
Solved Threads: 17
Junior Poster
mariocatch is offline Offline
103 posts
since Apr 2007
Aug 14th, 2009
0

Re: open exe file using c#

Thanks alot!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Owbon is offline Offline
2 posts
since Aug 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Delete an excel row
Next Thread in C# Forum Timeline: SqlBulkCopyColumnMapping NULL values





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC