Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,149 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,059 people online right now. Registration is fast and FREE... Join Now!




need help on creation and reading of login text file

 
Reply to this topicStart new topic

need help on creation and reading of login text file, need help on creation and reading of login text file

gibbsen
14 May, 2007 - 04:50 AM
Post #1

New D.I.C Head
*

Joined: 14 May, 2007
Posts: 3


My Contributions
Hi all,

I have a question here, i have done a simple ftp network sockets program. It works fine. Just that there is one part which i could not figure out how to do it. That is i need to create a login text file on my server end, so the server can authenticate clients that are trying to connect.

How can i read the whole file(login.txt) to compare against what the client enters ?. Take note that both the username and password are stored in the format as below in the text file. The admin word states that the user is an admin and is able to add users to that text file.

username password admin
username2 password2 admin
billy password10 user

How can i compare both the username and password ? what function do i need to use ? fseek ? Please kindly advise or if better please show some sample code. Thanks a lot. Really appreciate any form of help.


User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Need Help On Creation And Reading Of Login Text File
14 May, 2007 - 08:44 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
C or C++?
User is offlineProfile CardPM
+Quote Post

gibbsen
RE: Need Help On Creation And Reading Of Login Text File
14 May, 2007 - 05:24 PM
Post #3

New D.I.C Head
*

Joined: 14 May, 2007
Posts: 3


My Contributions
i did it in C++ . It best if i can see some c++ code, but c will do too . i know both c and c++.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:58PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month