查找exe文件路径 [英] Finding the exe file path
本文介绍了查找exe文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应如何以编程方式找到exe路径..
例如,我的程序文件中有一个已安装的应用程序exe
文件路径将根据64bi或32bit而有所不同
像c:\ Program Files或c:\ Program file(x86)
我应该如何通过仅提供文件名来查找文件的路径?
How shall i find the exe path programatically..
For example i have an installed application exe inside my program files
the file path will be different based on the 64bi or 32bit
like c:\Program Files or c:\Program file(x86)
How shall i find the path of a file by just giving the filename??
推荐答案
阅读此: ^ ]
看看这个答案.
获取应用程序的启动ADR [
Take a look at this answer.
get startup adr of application[^]
It might not be so obvious as using StartUpPath, as you might get unexpected results from it.
public static string StartupPath { get; }
获取启动应用程序的可执行文件的路径.
样本:
Gets the path for the executable file that started the application.
Sample:
private void PrintStartupPath()
{
textBox1.Text = Application.StartupPath;
}
这篇关于查找exe文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文