Is there any way to embed it in the program itself?
If you are hinting at modifying the assembly, then this is possible *, you will need to have two assemblies: one that is currently being executed, and one that you are modifying, because the executing assembly will be locked by the file system, and you need to reserve enough space for storing any new value that you intend to enter.
* To prove this to myself, I created a small executable file that simply writes the string value and uses a hex editor to change the string value.
You need to be smart enough about what changes you made, otherwise registering the software, and then just copying the modified binary to other machines will cost you the registration process.
Storing credentials in the registry is probably much simpler.
source share