
GetEnvironmentVariable Method | 553
The ‘My’
Reference
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Related Framework Entries
• Microsoft.VisualBasic.MyServices.FileSystemProxy.GetDriveInfo Method
• Microsoft.VisualBasic.FileIO.FileSystem.GetDriveInfo Method
• System.IO.DriveInfo Class
See Also
CurrentDirectory Property, Drives Property, FileSystem Object, FindInFiles Method,
GetDirectories Method, GetDirectoryInfo Method, GetFileInfo Method, GetFiles
Method, GetTempFileName 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 envi-
ronment 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 ...