Terminate a process after writing a message to the Windows Application event log in CSharp
Description
The following code shows how to terminate a process after writing a message to the Windows Application event log.
Example
/* www . ja va 2s . com*/
using System;
class Sample
{
public static void Main()
{
string causeOfFailure = "A failure has occured.";
try {
Environment.FailFast(causeOfFailure,new Exception());
}finally{
Console.WriteLine("This finally block will not be executed.");
}
}
}