简体   繁体   English

内置数据库

[英]Built-In Databases

Im wondering if theres a way to store information inside of a .exe file. 我想知道是否有一种方法可以在.exe文件中存储信息。 Like I've compiled an application using VS 2013 Express, but I'm going to need to be able to save once the program has been opened once, since something different happens the first time. 就像我使用VS 2013 Express编译应用程序一样,但是一旦程序被打开一次,我将需要能够保存,因为第一次会发生一些变化。 Is there any way I'd be able to save a boolean or a few booleans inside of my .exe instead of creating a .dll or .txt database on the host computer? 有什么方法可以在我的.exe文件中保存一个布尔值或几个布尔值,而不是在主机上创建.dll或.txt数据库? Creating an external database just seems like a bit of a waste for a handful of booleans. 对于少数布尔值而言,创建外部数据库似乎有点浪费。

Thanks! 谢谢!

Is there any way I'd be able to save a boolean or a few booleans inside of my .exe? 有什么办法可以在我的.exe文件中保存一个布尔值或几个布尔值?

No - executable files are not writable. 否-可执行文件不可写。 You'll need an external data store (file, database, etc.) 您将需要一个外部数据存储(文件,数据库等)

A config file is probably the easiest approach, and you can easily have config files per user (that are writable) with very little extra coding. 配置文件可能是最简单的方法,您只需很少的额外编码就可以轻松地为每个用户配置文件(可写)。

No you can't. 不,你不能。 The usual practice is to save your values in the Registry or somewhere in protected storage. 通常的做法是将值保存在注册表中或受保护的存储中的某个位置。

Windows将在执行该文件时锁定.exe文件,并且您无法修改此.exe(在其中存储类似于修改的文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM