简体   繁体   中英

Built-In Databases

Im wondering if theres a way to store information inside of a .exe file. 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. 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? 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?

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(在其中存储类似于修改的文件)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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