My.Application.Info.DirectoryPath 屬性
更新:2007 年 11 月
取得儲存應用程式的目錄。
' Usage Dim value As String = My.Application.Info.DirectoryPath ' Declaration Public ReadOnly Property DirectoryPath As String
傳回值
String,其中包含儲存應用程式的目錄。
備註
My.Application.Info.DirectoryPath 屬性會取得儲存應用程式的目錄。
範例
這個範例會使用 My.Application.Info.DirectoryPath 屬性,顯示儲存應用程式的目錄路徑。
MsgBox("Application directory path: " & My.Application.Info.DirectoryPath)
需求
命名空間:Microsoft.VisualBasic.ApplicationServices
類別︰AssemblyInfo
組件:Visual Basic 執行階段程式庫 (在 Microsoft.VisualBasic.dll 中)
依專案類型的可用性
專案類型 |
是否可用 |
---|---|
Windows 應用程式 |
是 |
類別庫 |
是 |
主控台應用程式 |
是 |
Windows 控制項程式庫 |
是 |
Web 控制項程式庫 |
否 |
Windows 服務 |
是 |
網站 |
否 |
使用權限
下列使用權限可能為必要:
使用權限 |
描述 |
---|---|
控制存取檔案和資料夾的功能。關聯的列舉型別:Unrestricted。 |