how to save user registration in the exe… (C#)

2019-07-24 23:27发布

问题:

Is this even possible?

I realize that asking them to enter data when the program runs and saving it in the executable file itself is out. (Or is it?)

Right now I'm considering trying to build the program server-side with php and have it incorporate a separate text file which would contain the information. This seems marginally feasible, though I would have quite a bit of learning to accomplish it.

I was hoping for some other ideas of how I might accomplish this.

I am not interested in separate configuration or text files or putting data in windows registry. I am only looking for solutions where it can be quite-solidly a part of the executable.

Does anybody have any experience with this?

Thank you.

回答1:

Its perfectly possible, that's how self-extracting zip files work.

Basically, you can add as much stuff to the end of the executable file as you want. Your program can then open its own file up on disk and read it back.



回答2:

How about using Settings within your app? It depends on what you mean by "storing the user registration" as to how you would best achieve this, though. If you could give some more information about what you actually want to store, that would be useful.

An example would be to save a username, or an authentication token, and use that each time you need to check a "registration". As I say, though, the details of what to store would depend entirely on what you want to do it that data...



回答3:

You could use it to embed in the unmanaged resources.