如何使应用程序设置独立的.exe文件的路径?应用程序、路径、独立、文件

2023-09-03 17:09:59 作者:爱人如己

假设我想从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等而要修复的位置,这可能帮助: 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?