VB.NET, C#, PowerShellを使用しているエンジニアのためのサイト。
基本的な使用方法から開発で役立つTipsまで幅広く取り扱っています。
VB6以前はApp.Pathでアプリケーションの実行パスを取得することが出来ました。VB.NETではSystem.AppDomain.CurrentDomain.BaseDirectoryで実行パスを取得することが出来ます
Imports System.IO : :省略 : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '変数を宣言する Dim strAppPath As String 'アプリケーションの実行パスを取得する strAppPath = System.AppDomain.CurrentDomain.BaseDirectory '取得したアプリケーションの実行パスを表示する MessageBox.Show("アプリケーション実行パスは[" & strAppPath & "]です") End Sub