Q:

C# program to demonstrate the use of FailFast() method of Environment class

0

Syntax:

void Environment.FailFast(string eventLog);

Parameter(s):

  • eventLog: a message that will be logged in the windows application event log.

Return value:

This method does not return any value.

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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.

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 . . .

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now