DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    1

    Question need help about binaryReader/writer or random acce

    hi everyone...
    i'm a newly member here.
    i got some questions about using binaryWriter and Reader with Array.

    my new project requires a user access (register & login) application. all the user data (username & password) have to be stored in a DAT file.
    i usually use strem reader/writer. i don't know about binary or random access (for binary).

    I really need helps from all u guys.

    please...

    if u can provide examples code, it would be awesome
    full code, that's gonna be better :P

    thx in advanced... (24 hours reply required... please...)

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    username and password in a data file??? which kind of security is that?

    To write two strings in a binary file:

    Code:
        Dim f As Integer
        f = FreeFile
        
        Open "c:\s.dat" For Binary Access Write As f
        Dim u As Variant
        Dim p As Variant
        u = "My user account"
        p = "My password"
        Put f, , u
        Put f, , p
        Close f
    and to read them:

    Code:
        Open "c:\s.dat" For Binary Access Read As f
        Get f, , u
        Get f, , p
        Close f
    The strings must be in a Variant so VB knows how to convert them from the file.
    But careful: anyone can open the file in notepad and read them!

    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Similar Threads

  1. Database & Random Numbers
    By Suze in forum VB Classic
    Replies: 2
    Last Post: 05-10-2005, 03:41 PM
  2. random() and srandom() unresolved links
    By ozmanbozman in forum C++
    Replies: 25
    Last Post: 02-17-2005, 06:39 AM
  3. ADO random selection
    By rudy rusli in forum VB Classic
    Replies: 2
    Last Post: 03-22-2002, 08:43 AM
  4. random numbers
    By max in forum Java
    Replies: 2
    Last Post: 04-30-2001, 03:08 PM
  5. Replies: 0
    Last Post: 08-25-2000, 07:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links