private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName ="c:\\a.txt";
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized;
MessageBox.Show("1");
p.Start();
MessageBox.Show("2");
//Wait until the process passes back an exit code
p.WaitForExit();
MessageBox.Show("3");
//Free resources associated with this process
p.Close();
MessageBox.Show("4");
}
using System.Threading;
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process process = System.Diagnostics.Process.Start("IExplore.exe", "www.cnn.com");
MessageBox.Show("1");
Thread.Sleep(15000);
MessageBox.Show("2");
try
{
process.Kill();
}
catch { }
MessageBox.Show("3");
}
System.Diagnostics.Process process = System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\mspaint", "c:\\a1.jpg");
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine("hi");
}
public static void WriteLine(string message)
Member of System.Diagnostics.Debug // -> این مسیر را.
Summary:
Writes a message followed by a line terminator to the trace listeners in the System.Diagnostics.Debug.Listeners collection.
Parameters:
message: A message to write.