Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-26-2009, 06:43 PM   #1
In Runtime
 
Join Date: Dec 2001
Posts: 154
Default output data from dat file to memory

I am looking to compare a username and password that a user sets in the beginning of a program and save it. When the user reopens the program again at a later date, I would like to be able to have the user reinput the username and password and have it verified from the saved file. I am able to have the user input the data to a dat file but cannot retrieve the information from the file to verify it. Any suggestions.
__________________

Hid_Enigma is offline   Reply With Quote
Old 02-26-2009, 08:53 PM   #2
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: output data from dat file to memory

What you are trying to do has a lot of solutions. Could you provide more information about your application?

What language are you writing it in?

Also, this doesn't seem very secure, why not use a database?
__________________

__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 02-26-2009, 09:10 PM   #3
In Runtime
 
Join Date: Dec 2001
Posts: 154
Default Re: output data from dat file to memory

Sorry using C++ as far as a database right now i am not to familiar with using databases. What i need to store is just a user and pass on the local machine. What the program will need to do is have the user input the user and pass they would want to use to run the program. then once the user and pass is inputted I was thinking about using a small if else statement to check the user and pass with the one stored in the file. if they match then the program runs if they dont it says invalid user and pass. Then the program gives them an option to try again or to end. Now this program really doesn't need to have a username and password but want to get practice on using the code to do this.
Thanks in advance
Hid_Enigma is offline   Reply With Quote
Old 02-27-2009, 09:31 AM   #4
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: output data from dat file to memory

I see. In the future, when you have a better handle on databases and encrypting user information, I suggest you do it that way. I am a bit rusty on my c++, there are many on this forum much more well versed than I am. Here is a link to an article that talks about File I/O processes in c++.
http://www.cplusplus.com/doc/tutorial/files.html

In their example, they output whatever is found in the text file to the screen. Instead, you could format the text file on two lines and have the username on the first and the password on the second, and read the two lines into two separate variables then compare those values against what the user input. Hope this is helpful, please ask for clarification on anything I didn't make clear.
__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 05:02 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0