Environment.FailFast immediately terminates a process after writing a message to the Windows Application event log : Environment « Development « VB.Net






Environment.FailFast immediately terminates a process after writing a message to the Windows Application event log

 

Imports System

Class Sample
    Public Shared Sub Main() 
        Dim causeOfFailure As String = "A castrophic failure has occured."
        Try
            Environment.FailFast(causeOfFailure)
        Finally
            Console.WriteLine("This finally block will not be executed.")
        End Try

    End Sub 'Main
End Class 'Sample

   
  








Related examples in the same category

1.Environment Class provides information about current environment and platform
2.Sample for Environment class summary
3.Get Environment variables
4.Environment.CurrentDirectory Property gets or sets the fully qualified path of the current working directory.
5.Environment.Exit Method terminates this process and gives the underlying operating system the specified exit code.
6.Environment.ExitCode Property gets or sets the exit code of the process.
7.Environment.ExpandEnvironmentVariables Method replaces the name of each environment variable embedded in string
8.Environment.GetCommandLineArgs returns a string array containing the command-line arguments for the current process.
9.Environment.GetEnvironmentVariables Method retrieves all environment variable names and their values
10.Environment.GetFolderPath (Environment.SpecialFolder)
11.Environment.GetLogicalDrives returns the logical drives on the current computer.
12.Environment.MachineName Property gets the NetBIOS name of this local computer.
13.Environment.NewLine Property gets the newline string defined for this environment.
14.Environment.OSVersion Property gets platform identifier and version number.
15.Environment.ProcessorCount Property gets the number of processors on the current machine.
16.Environment.StackTrace Property gets current stack trace information.
17.Environment.SystemDirectory Property gets the fully qualified path of the system directory.
18.Environment.TickCount Property gets the number of milliseconds elapsed since the system started.
19.Environment.UserDomainName Property gets the network domain name associated with the current user.
20.Environment.UserInteractive Property tells whether the current process is running in user interactive mode.
21.Environment.UserName Property gets the user name of the person who is currently logged on to the Windows operating system.
22.Environment.Version Property describes the major, minor, build, and revision numbers of the common language runtime.
23.Environment.WorkingSet Property gets the amount of physical memory mapped to the process context.
24.Get the common language runtime version.