TRENDING NEWS

POPULAR NEWS

Visual Basic How To Write Text To A .dat File That Doesn

Text File Locking in C++?

You're going to have to encrypt the file in some fashion. This doesn't have to be advanced, just advanced enough to make it hard on the user to know what information they are changing inside the file (the less human readable the better). You won't be able to stop people from reading the contents and changing them if they _really_ want to. It's as simple as getting a hex editor and opening the file. So all in all, some form of encryption or obscurity over your dat file is required. Also, do your reads and writes in binary this will give you one extra bit of obscurity. Which is a long topic to discuss. Try to find a way to encode your output strings into some obscure format that you can decode in the future. Could be as simple as a one bit shift.
(1) open file for write in binary
(2) take your input string, get an int array for all the chars
(3) for each character less than 128 decimal char = char << 1 (bit shift left by 1 power of 2); //this will shift the 7bit character into an 8bit one and obscure what it actually is. This is by no means an encryption approach but it could provide the obscurity you might want. This also of course limits your dat file to have characters only in the range of 0 to 127 otherwise there is no way to know which character upon reading should be shifted right (char = char >> 1)
(4) output each character in sequence into your dat file

Anyway, just some ideas, good luck :)

What programs should I make as a beginner? I already know some C#, and have done many language exercises and puzzles. But never an actual program.

So, when I was a beginner I started to do something interesting that carried into my programming career and served as the foundation to how I learn new tools and such. For whatever reason I don’t find too many other people doing this, so it can be your advantage if you use it yourself.Back in 1995 when I first got super interested in computers, the world was a very different place. The internet was primarily text and chat rooms and email. If you wanted to learn something, you went to the library or bookstore and got a book on the topic.There was no Quora to ask questions to...For reasons I don’t really understand, I decided I wanted to write software “when I grow up” and so I got a book on C programming and read it.It was like a 600 page book called Teach Yourself C in 21 days. I read it in 7th grade and taught myself how to code.It was the most basic kinds of programs I built. Things like, hello world, but maybe with my name inserted in there. Or I probably built a basic calculator of some kind.There was no GUI. There was text input/output.Eventually I got interested in making my own video games, so I got more books and got to work.Along the way of trying to make my own version of pong, I got really low level by accident and started learning about some very fundamental, old-school graphics primitives and such.That was a misadventure that eventually led to a game programming library called Allegro. I believe it still exists.Anyway, over time I found myself in this endless loop of wanting to make something or solve a problem, then going out and figuring out how to do that.That habit of not knowing what I need to know, and having a desire to build something interesting anyway forced me to learn more and go further than anything else in my career.Now if I’m going to learn a new technology, pattern, or technique, I give myself a project I want to build where I could use it.Or better yet...I decide I want to build something, then I blindly figure out what I need to do to make it real.It doesn’t matter of my projects are particularly interesting or useful to anyone but me because what I learn along the way is so darned valuable.So, go out and build something that is interesting to you and along the way learn what you have to learn to make it real.And if you don’t have a good idea, go make your own version of Pong. You’ll learn a lot along the way.-BrianP.S. Have you seen Creative Genius yet?

TRENDING NEWS