如何获得ClickOnce应用程序文件夹路径 [英] How to get folder path for ClickOnce application

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

问题描述

我需要在控制台的ClickOnce 。应用(可执行文件)所在的同一文件夹写入文件。它从启动文件夹。

I need to write a file in the same folder where a console ClickOnce .application (executable file) resides. The folder where it launches from.

我试图用 Application.StartupPath &放大器; Path.GetDirectoryName(Assembly.GetExecutingAssembly()位置) 但路径指向一个子文件夹下的 C:\文件和放大器;设置。我该如何获取路径,其中。应用位于?

I tried using Application.StartupPath & Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) but the path is pointing to a subfolder under c:\Documents & Settings. How do I get the path where the .application resides in?

推荐答案

要找到该文件夹​​的位置,你可以运行应用程序,打开任务管理器(CTRL-SHIFT-ESC),选择应用程序,然后右键单击|打开文件位置。

To find the folder location, you can just run the app, open the task manager (CTRL-SHIFT-ESC), select the app and right-click|Open file location.

这篇关于如何获得ClickOnce应用程序文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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