如何使应用程序设置独立的.exe文件的路径? [英] How to make application settings independent of .exe path?

查看:160
本文介绍了如何使应用程序设置独立的.exe文件的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想从C移至我的应用程序:\ MyApp.exe的到D:\ MyApp.exe的。它会失去所有的设置。如何prevent呢?

Suppose I want to move my app from c:\myapp.exe to d:\myapp.exe. It will loose all settings. How to prevent that?

推荐答案

我个人使用注册表来保存和载入我的设置,所以我的应用程序的位置不会受到影响,但如果你使用User.Config等而要修复的位置,这可能帮助: <一href="http://stackoverflow.com/questions/621265/can-i-control-the-location-of-net-user-settings-to-avoid-losing-settings-on-app">Can我控制.NET用户设置的位置,以避免失去对应用程序的设置升级?

Personally I use the registry to save and load my settings, so the location of my application isn't affected, but if you're using User.Config etc and want to fix the location, this might help: Can I control the location of .NET user settings to avoid losing settings on application upgrade?

这篇关于如何使应用程序设置独立的.exe文件的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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