It demonstrates the Kill method. At this point, the "notepad" process is no longer running.
Sleep
VB.NET program that uses Kill
Module Module1
Sub Main()
' Start the notepad.exe Process.
Dim p As Process = Process.Start("notepad")
Console.WriteLine("Started")
' Sleep for one second.
Threading.Thread.Sleep(1000)
' Terminate.
p.Kill()
Console.WriteLine("Killed")
End Sub
End Module
Result
1. Notepad is started.
2. One second passes.
3. Notepad is killed.
Sleep
VB.NET program that uses Kill
Module Module1
Sub Main()
' Start the notepad.exe Process.
Dim p As Process = Process.Start("notepad")
Console.WriteLine("Started")
' Sleep for one second.
Threading.Thread.Sleep(1000)
' Terminate.
p.Kill()
Console.WriteLine("Killed")
End Sub
End Module
Result
1. Notepad is started.
2. One second passes.
3. Notepad is killed.