User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 375,207 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,300 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 399 | Replies: 1 | Solved
Reply
Join Date: May 2008
Posts: 7
Reputation: kousarrabiya is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
kousarrabiya's Avatar
kousarrabiya kousarrabiya is offline Offline
Newbie Poster

Contents of DAT file are not in binary format

  #1  
May 16th, 2008
Hi, Iam trying to put username and password in some dat file(ADMIN.DAT)from changeLogin page and getting/retreiving username and password from another page from ADMIN.DAT file....
My problem is username and password details are getting stored in dat file in readable text format NOT IN BINARY..

Writing into file part is
dname = My.DataFile("ADMIN.DAT")
fnum = FreeFile
Open dname For Binary Access Write As #fnum
Put #fnum, , uname
Put #fnum, , pwd

Close #fnum

Reading from file part is
dname = My.DataFile("ADMIN.DAT")
fnum = FreeFile
Open dname For Binary Access Read As #fnum

Get #fnum, , uname
Get #fnum, , pwd

Close #fnum

Any suggestions plz...
Last edited by kousarrabiya : May 16th, 2008 at 5:02 am. Reason: I press tab it got posted i don no y..
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2008
Posts: 7
Reputation: kousarrabiya is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
kousarrabiya's Avatar
kousarrabiya kousarrabiya is offline Offline
Newbie Poster

Re: Contents of DAT file are not in binary format

  #2  
May 22nd, 2008
I got the solution...
Since username and password are taken as string they cannot be stored in binary format in DAT file...
So i used Input and Output instead of Binary for file to open..

Writing into the file part is
dname = App.Path & "\ADMIN.DAT"
fnum = FreeFile
Open dname For Output Access Write As #fnum
Print #fnum, uname
Print #fnum, pwd
Close #fnum


Reading from the file part is
dname = App.Path & "\ADMIN.DAT"
fnum = FreeFile

Open dname For Input Access Read As #fnum
Input #fnum, uname
Input #fnum,pwd
close #fnum
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 2:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC