📅  最后修改于: 2023-12-03 14:39:18.785000             🧑  作者: Mango
Application.ExecutablePath
is a property that returns the full path of the current application's executable file. This property is available in both VB.NET and VBA programming languages.
The syntax for using Application.ExecutablePath
is as follows:
In VB.NET:
Dim executablePath As String = Application.ExecutablePath
In VBA:
Dim executablePath As String
executablePath = Application.ExecutablePath
Here is a sample code snippet that demonstrates the usage of Application.ExecutablePath
in VB.NET:
Imports System.IO
Module Module1
Sub Main()
Dim executablePath As String = Application.ExecutablePath
Console.WriteLine("Executable Path: " & executablePath)
Dim directoryPath As String = Path.GetDirectoryName(executablePath)
Console.WriteLine("Directory Path: " & directoryPath)
End Sub
End Module
The above code snippet will print the executable path and its directory path to the console.
Application.ExecutablePath
includes the file name of the executable file.Application
object, which refers to the current instance of the application.