Save data in executable

后端 未结 7 1320
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:54

    There is one way using multiple streams, but only works in NTFS filesystems. NTFS allows you to define alternative "named" streams in one file. The usual content is in the main = unnamed stream. It has something to do with the extra info you can see when you right click a file and check properties.
    Unfortunatly C# has no support for multiple streams, but there are open source pojects that can help you.

    See this link for a nice wrapper to read and write multiple streams to one single file in C#

提交回复
热议问题