用户个人资料文件夹中的本地和漫游文件夹 [英] Local and Roaming Folder in users profile folder

查看:98
本文介绍了用户个人资料文件夹中的本地和漫游文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我已经开发了一些应用程序,我已经部署了很多次。 我已经习惯于在C:\ Users \< username> \ AppData \ Local文件夹中存储应用程序的不同文件以供用户访问。 在开发期间
它会将它保存在我的电脑上我的罚款。 但是一旦部署到用户的机器上,它将保存到我指定的其他地址。 例如:  C:\ Users \ < username> \ AppData \ Local \ Apps\\\\\\\\\\\\\\\\\\\\\ / p>

我的问题是,是否有一些设置要检查用户计算机? 我希望它更喜欢使用示例:  C:\ Users \< username> \ AppData \ Local或  C: \ Users \<用户名> \ APPData \Roaming


我目前在开发计算机上运行Windows 10 Pro和Visual Studio 2013 Pro。 当我在windows xp,windows vista,windows 7和windows 10机器上部署我的应用程序时,我经常会遇到这个问题。


我希望这个详细到足以让我们能够理解。  ;任何类型的帮助都表示赞赏。


谢谢,


迈克


解决方案

嗨迈克,


> ;>我的问题是,是否有一些设置可以检查用户计算机? 我希望它更喜欢使用示例:C:\ Users \< username> \ AppData \ Local或C:\ Users \< username> \ AppData \Roaming


我担心简短的回答是否定的。


ClickOnce的安装路径已修复,您无法自行修改。


你可以通过以下方式获得真正的路径:

 //安装后的数据路径
string dataPath = System .IO.Directory.GetParent(Application.CommonAppDataPath)的ToString();安装后
//.exe路径
string exePath = Assembly.GetExecutingAssembly()。Location;

问候,


斯坦利


Hi. I have deployed quite a few click once application's that I have developed.  I have become accustomed to storing different files for the application in the C:\Users\<username>\AppData\Local folder for user access.  During development it will save it on my computer my fine.  But once deployed to the user's machine it will save to a different address other than what I specified.  For example: C:\Users\<username>\AppData\Local\Apps\2.0\EC85CV3C.YQM\MVO944EB.Z7L

My question is would there be some settings to check on the users computer?  I would like prefer it to use example: C:\Users\<username>\AppData\Local or C:\Users\<username>\AppData\Roaming

I am currently running Windows 10 Pro and Visual Studio 2013 Pro on my development computer.  I typically run into this issue when I deploy my application on a windows xp, windows vista, windows 7 and windows 10 machines.

I hope this was detailed enough to be able to understand.  Any type of help is appreciated.

Thank you,

Mike

解决方案

Hi Mike,

>>My question is would there be some settings to check on the users computer?  I would like prefer it to use example: C:\Users\<username>\AppData\Local or C:\Users\<username>\AppData\Roaming

I'm afraid the short answer is no.

The install path of ClickOnce is fixed and you can not modify it by yourself.

You just can get the real path with:

    //data path after install
    string dataPath = System.IO.Directory.GetParent(Application.CommonAppDataPath).ToString();
    //.exe path after install
    string exePath = Assembly.GetExecutingAssembly().Location;

Regards,

Stanly


这篇关于用户个人资料文件夹中的本地和漫游文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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