Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi, i want to save and load text in textfile that i made in resources, please tell me how to do it?!
thanks

What I have tried:

handle textfile to save hdd serial with algorithm and create password to stop program being copied
Posted
Updated 19-Jul-16 5:46am

1 solution

You can save a text file into the resources - it's easy, and I do it with every project for revision history purposes.
But...you can't easily put a different text file into each installation of the assembly, not without rebuilding the application for each separate installation. That's messy, and dangerous - because you can easily end up with changes going out that you don't know about.
Instead, create the licence file and store it in a "sensible place" - don't try to make it a part of the EXE file. Where should I store my data?[^] may help - and if you use the application GUID as part of the path, it won't be easy to find.
 
Share this answer
 
Comments
Member 12643088 19-Jul-16 13:01pm    
but how to save it into resources? i'm getting dll errors when i trying to do it, please give me a code
OriginalGriff 19-Jul-16 13:59pm    
Don't try - resources are stored inside the assembly, so for each new HDD you'd have to produce a different EXE file!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900