如何获取指定文件夹的确切路径 [英] How can i get the exact path of specified folder

查看:90
本文介绍了如何获取指定文件夹的确切路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将帮助文件放在了应用程序文件夹中.例如,我在D驱动器中创建了我的应用程序即ACH,这样我的帮助文件将位于此位置


D:\ ACH \ Help.chm

当用户在我的表单上按F1时,我想打开它.直接写路径怎么办?

我想得到路径D:\ ACH任何想法

实际情况是,如果我为我的应用程序创建一个MSI并将其提供给用户,他可以在任何地方安装,以便当他运行该应用程序并单击F1寻求帮助时,我想打开已安装的Folder

I placed my help file in my application folder. For example i created my application namely ACH in D drive such that my help file will be in this location


D:\ACH\Help.chm

I would like to open this when the user press F1 on my form. How can i get this with out writing the path directly.

I would like to get the path D:\ACH any idea

The actual is if i create an MSI for my application and give it to user he can install anywhere so that when he runs the application and clicks on F1 for help i would like to open the chm file that was in the installed folder

推荐答案

尝试一下

字符串路径= System.IO.Path.GetDirectoryName(Application.ExecutablePath);
Try this

string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath);


这篇关于如何获取指定文件夹的确切路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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