I came across a program SelfNote which stores all the text we write and the password in itself.No other file is created (the EXE changes its size as we change it's contents) . It is a standalone exe with all the content within it.
How can an exe modify itself ?
Is this possible in VB.net ??

Re: Does VB.Net support 'self contained' apps ? 80 80

Possible? Yes. Off the top of my head, I'd probably approach it as storing the settings in an embedded resource, then replacing that resource when settings change.

However, this strikes me as an unnnecessary complication. I don't see any good reason why you can't distribute a config file along with your executable and use the usual settings methods. The password can (and should) of course be encrypted when stored in a user-accessible location, but that's trivial to do.

In terms of an executable modifying itself, there's a hard limitation of the file being locked while loaded in memory. So any solution would need to work around this limitation. Therein lies the rub, because now you're either using tricks like the resource replacement I mentioned, or actively disassembling and reassembling the IL from the client side (not a good idea in general).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.