. Write program, that run one of two applications (Calculator or MS Paint) after user pushed corresponding button “Run”. In editbox user indicates the time (in seconds) after which the application closes.
using System.Threading;
void Button1Click(object sender, EventArgs e)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "calc"; //p.StartInfo.FileName = "mspaint"; - for MS Paint
p.Start();
Thread.Sleep(Convert.ToInt32(textBox1.Text) * 1000);
p.Kill();
}
Comments
Leave a comment