The source code to demonstrate the use of FailFast() method of Environment class is given below. The given program is compiled and executed successfully.
using System;
class Sample
{
//Entry point of Program
static public void Main()
{
Console.WriteLine("Program before termination of process");
Environment.FailFast("Terminate program by Me");
Console.WriteLine("Program after termination of process");
}
}
Output:
Program before termination of process
Press any key to continue . . .
Program:
The source code to demonstrate the use of FailFast() method of Environment class is given below. The given program is compiled and executed successfully.
Output: