表紙 > VB.NET サンプル >
実行中のプログラムのパスを取得する
以下の例では、実行中のexeのフルパスを表示する。
Dim FullPath As String FullPath = Application.ExecutablePath
MsgBox(FullPath)
メモ:この例は通常、Windowsアプリケーション上でのみ実行可能です。
以下の例では、実行中のexeのフォルダ名を表示する。
Dim FolderName As String FolderName = Application.StartupPath
MsgBox(FolderName)
メモ:この例は通常、Windowsアプリケーション上でのみ実行可能です。
以下の例では、実行中のdllのフルパスを表示する。
Dim FullPath As String FullPath = Me.GetType.Assembly.Location
MsgBox(FullPath)
メモ:この例はexeでも実行可能です。
VB6ではApp.EXENameおよびApp.Pathを使用します。
→ VB6 プログラムのパスを取得する