C#如何在内部将设置保存在exe文件中? [英] C# How do I save settings internally in an exe file?
问题描述
我已经在寻找此代码几周了,但是找不到让我直接将应用程序设置保存在exe文件中的任何内容,我这样做的原因是使应用程序在用户之间可移植.
我只是希望能够在exe文件中存储一些字符串,到目前为止,似乎还没有办法.
我当前的代码使用Application.Settings,但是它存储值在%Application Data%\ ApplicationName_exe ...中,该文件夹不仅可以将设置保留为纯文本格式,而且还位于exe文件的外部.
我不相信这种简单的必要性不是
-BlkDemon
I have been looking for this code for weeks but can't find anything that will let me save my application settings directly inside of the exe file, the reason I need to do this is to make the application portable between users.
I simply want to be able to store a few strings inside the exe file, and as of yet there seems to be no way of doing this.
My current code uses Application.Settings but this stores the values in %Application Data%\ApplicationName_exe..., a folder which not only keeps the settings in plain text but also is outside of the exe file.
I can't believe this simple necessity isn't implemented anywhere and all the source code needs to be written just to add a few strings!
-BlkDemon
推荐答案
到底是什么使您成为现实的?认为这完全有可能吗?不是..exe文件是不可变的.在过去的30年中,这从来都不是问题.如果要保持此线程移动,您必须解释一下真正的挂机.
What on Earth made you think this is possible at all? It isn't, the .exe file is immutable. In the past 30 years, that's never been a problem. You'll have to explain your real hang-up if you want to keep this thread moving.
这篇关于C#如何在内部将设置保存在exe文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!