My.Application Object
Provides properties, methods, and events related to the current application.
This example uses the My.Application.CommandLineArgs property to examine the application's command-line arguments. If an argument is found that starts with /input=, the rest of that argument is displayed.
Private Sub ParseCommandLineArgs() Dim inputArgument As String = "/input=" Dim inputName As String = "" For Each s As String In My.Application.CommandLineArgs If s.ToLower.StartsWith(inputArgument) Then inputName = s.Remove(0, inputArgument.Length) End If Next If inputName = "" Then MsgBox("No input name") Else MsgBox("Input name: " & inputName) End If End Sub
Namespace: Microsoft.VisualBasic.ApplicationServices
Class: WindowsFormsApplicationBase (the base class ConsoleApplicationBase provides members available in console applications, and its base class ApplicationBase provides the members that are available in all projects)
Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)