Save data in executable

后端 未结 7 1246
Happy的楠姐
Happy的楠姐 2021-02-04 13:12

I have a portable executable that saves data to a file in the same folder as the executable. Is there any way that I can save data into the executable itself when I close the ap

7条回答
  •  时光说笑
    2021-02-04 13:48

    Alternate data streams might work. By using the ::stream syntax you can create a data stream within your exe and read/write data. Edit: to create/access an alternate data stream, you will use a different filename. Something like: applicAtion.exe:settings:$data this will access a data stream named "settings" within application.exe. To do this you need to add the :settings:$data to the filename when reading or writing to the file. This functionality is provided by ntfs so it shold work in c# and should work when the application is running.

    Additional information is available at: http://msdn.microsoft.com/en-us/library/aa364404(VS.85).aspx

提交回复
热议问题