在 VB.NET 中获取程序路径? [英] Get program path in VB.NET?

查看:26
本文介绍了在 VB.NET 中获取程序路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取我正在运行的程序的绝对路径?

How can I get the absolute path of program I'm running?

推荐答案

为此,您可以使用 Application 对象.

For that you can use the Application object.

启动路径,只是文件夹,使用Application.StartupPath()

Startup path, just the folder, use Application.StartupPath()

Dim appPath As String = Application.StartupPath()

完整的 .exe 路径,包括末尾的 program.exe 名称:,使用 Application.ExecutablePath()

Full .exe path, including the program.exe name on the end:, use Application.ExecutablePath()

Dim exePath As String = Application.ExecutablePath()

这篇关于在 VB.NET 中获取程序路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆