My.Application.Run Method

Sets up and starts the Visual Basic Application model.

' Usage
My.Application.Run(commandLine)
' Declaration
Public Sub Run( _
   ByVal commandLine As String() _
)

Parameters

  • commandLine
    Array of type String. The command line from Sub Main.

Remarks

The My.Application.Run method provides support for the Visual Basic Application model. This method should be called only from the application's Sub Main. By default, the Sub Main of a Windows Forms application calls this method. For more information, see Overview of the Visual Basic Application Model.

Requirements

Namespace:Microsoft.VisualBasic.ApplicationServices

Class:WindowsFormsApplicationBase

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type

Available

Windows Application

Yes

Class Library

No

Console Application

No

Windows Control Library

No

Web Control Library

No

Windows Service

No

Web Site

No

Permissions

The following permissions may be necessary:

Permission

Description

EnvironmentPermission

Controls the ability to access all environment variables. Associated enumeration: Unrestricted.

FileIOPermission

Controls the ability to access files and folders. Associated enumeration: Unrestricted.

RegistryPermission

Controls the ability to access registry variables. Associated enumeration: Unrestricted.

UIPermission

Controls the permissions related to user interfaces and the clipboard. Associated enumeration: AllWindows.

WebPermission

Controls rights to access HTTP Internet resources. Associated enumeration: Unrestricted.

SocketPermission

Controls rights to make or accept connections on a transport address. Associated enumeration: Unrestricted.

PerformanceCounterPermission

Controls access to a Windows NT performance counter component. Associated enumeration: Unrestricted.

For more information, see Code Access Security and Requesting Permissions.

See Also

Concepts

Overview of the Visual Basic Application Model

Reference

My.Application Object

WindowsFormsApplicationBase.Run