|
-
Dec 7th, 2007, 03:44 PM
#1
Thread Starter
Hyperactive Member
Using Saved .TEXT or .SAVE to get Info
Hi, I'm createing a Application that has a login to it, what I need it to do is when they create an account, it will save all their information as a .SAVE file or .TEXT, it then will be read when they press Login, and if their Username and Account name Match up then it lets them login.
I'm somewhat new to C#, so some Examples / CODE be nice.
Thanks, wesley008
-
Dec 8th, 2007, 07:43 AM
#2
Re: Using Saved .TEXT or .SAVE to get Info
Firstly, is it really wise to store each account record in a separate file? That would present various issues, not least of which would be that to validate a login you would have to open each and every file until you found one that matched. A better bet would be to store your account information altogether in one place. A database would be the best bet but, if you must use a text file then an XML file would be easy to read and write to and from a DataSet, allowing very easy access to the data.
Also, you say:
I need it to do is when they create an account, it will save all their information as a .SAVE file or .TEXT
but that tells us nothing. They are just file extensions of your own making. That doesn't tell us anything about the format of the files. I assume you mean to store plain text, but in what format? Will each field be on a different line? Will each field be named in the file?
If you really want to read and write text files then you can use StreamReader and StreamWriter objects, or the methods of the File class. Exactly what data you read and write and how you handle it is really up to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|