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 服务

网站

权限

以下权限可能是必需的:

权限

说明

FileIOPermission

控制访问文件和文件夹的能力。关联的枚举:Unrestricted

有关更多信息,请参见代码访问安全性请求权限

请参见

参考

My.Application.Info 对象

AssemblyInfo.DirectoryPath