GetEnvironmentVariable Method


GetEnvironmentVariable Method

Location

My.Application.GetEnvironmentVariable

Syntax

     Dim result As String = My.Application.GetEnvironmentVariable(name) 


name (required; String)

The name of the environment variable value to return

Description

The GetEnvironmentVariable method returns the value of the named Windows environment variable.

Usage at a Glance

  • An exception is thrown if an invalid or unknown name is used.

  • An exception is thrown if the current user lacks sufficient security privileges to query environment variables.

Example

The following example displays the value of the triggerValue environment variable.

     Try        MsgBox("Application triggered at " & _           My.Application.GetEnvironmentVariable("TriggerValue"))     Catch ex As System.ArgumentException        MsgBox("Trigger value not configured.")     End Try 

Related Framework Entries

  • System.Environment.GetEnvironmentVariable Method

See Also

Application Object, CommandLineArgs Property




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net