ClickOnce应用程序用户设置的位置 [英] ClickOnce Application User Settings Locations

查看:396
本文介绍了ClickOnce应用程序用户设置的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个ClickOnce应用程序的转换CSV文件数据库更新。该计划要求用户必须更改配置文件为数据库的变化,并改变其填充在应用程序下拉列表的XML文件的能力。

I am currently developing a ClickOnce application that converts CSV files for a database update. The program requires the user to have the ability to change the config files for a database change, and change an xml file which populates a drop-down list in the app.

不是我理解的文件保存在用户/应用程序数据文件夹,以确保有正确的权限,但我有任何影响,以什么这些文件夹被称为,或者它们将被保存?

Not I understand that the files are kept in the user/appdata folder to ensure there are correct privileges, but do I have any influence as to what those folders are called, or where they are saved?

默认情况下,该文件保存在 AppData\Local\Apps\2.0\LD7ZEJK0.7AE\NJ42PEPW.1QX\csvt ... exe_169e1a4011fbe7ec_0001.0000_none_04507fe9e077ae84

By default, the files are saved in AppData\Local\Apps\2.0\LD7ZEJK0.7AE\NJ42PEPW.1QX\csvt...exe_169e1a4011fbe7ec_0001.0000_none_04507fe9e077ae84

我可以改变说 Documents\CSV_Files 或类似的东西?如果我这样做,我将如何引用在配置文件中的XML文件,使程序知道它在哪里?

Can I change that to say Documents\CSV_Files or something similar? And if I do, how would I reference the xml file in the config file so the program knows where it is?

推荐答案

通常,你不应该关心自己的位置。只需标记您的XML文件中的ClickOnce舱单数据并使用它访问著名的:

Normally, you shouldn't have to care about the location yourself. Just mark your XML file as data in the ClickOnce manifest and access it using the well-known:

ApplicationDeployment.CurrentDeployment.DataDirectory

下面是描述它的MSDN文章:的在ClickOnce应用程序访问本地和远程数据

Here's an MSDN article describing it: Accessing Local and Remote Data in ClickOnce Applications

这篇关于ClickOnce应用程序用户设置的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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