
510
|
Chapter 13: 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.CombinePath Method
• Microsoft.VisualBasic.FileIO.FileSystem.CombinePath Method
• System.IO.Path.Combine Method
See Also
FileSystemObject, GetName Method, GetParentPath Method
CommandLineArgs Property
Location
My.Application.CommandLineArgs
Syntax
Dim result As System.Collections.ObjectModel.ReadOnlyCollection( _
Of String) = My.Application.CommandLineArgs
Description
The CommandLineArgs property returns a collection of each space-delimited argu-
ment from the command-line text used to initiate the application. This collection
includes the arguments only; the application path used to start the application is not
included. The System.Environment.CommandLine property, on the other hand,
includes the application path.
Usage at a Glance
• This property is read-only.
• If your application is configured to run as a single instance only, this property will
always return the command-line arguments for the initial instance. To view the
arguments for subsequent instances, use the My.Application.StartupNextInstance
event and examine the CommandLine property of the second parameter (
e) for
that event.
Example
The following example looks for the argument “/?” and takes action when found.
Private Sub ...