CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2001
    Posts
    52

    UserDatabase in a DLL

    I want to write a UserDatabase in a DLL which allows to store Usernames and Passwords in a Bin or Ascii-File. How can I write Data to a ascii File. Has anyone a tutorial on File I/o?

    Please help me !?!

  2. #2
    Join Date
    May 2000
    Location
    Washington DC, USA
    Posts
    715
    look up fprintf and or fopen. To retreive them programatically you could use fscanf.

    #include <stdio.h>
    #include <process.h>

    FILE *stream;

    void PutLogin( char *pszUserid, char pszPassword )
    {
    char c = '\n';

    stream = fopen( "fprintf.out", "a+);
    fprintf( stream, "%s\t%s\n", szUserid, pszPassword );
    fclose( stream );
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured