Password Problems

This is a discussion on Password Problems within the Windows Programming forums, part of the Platform Specific Boards category; I'm trying to check whats entered in an edit box with the contentes of a file like a password but ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    81

    Password Problems

    I'm trying to check whats entered in an edit box with the contentes of a file like a password but this doesn't seem to work right, heres what i have.

    char PassEntered[50];
    char CorrectPass[50];
    FILE *PassChk;
    PassChk = fopen("PassChk.dat", "r");
    fgets(CorrectPass,50,PassChk);
    GetWindowText(pass,PassEntered,50);
    if(CorrectPass == PassEntered)
    {
    SetWindowText(hwnd, "Correct");
    }
    else
    {
    SetWindowText(hwnd, "InCorrect");
    }
    fclose(PassChk);

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,662
    Look here. You cannot compare strings with "=="...



    ITSA
    Socket Library!

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    81
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String compare problems
    By swgh in forum C Programming
    Replies: 5
    Last Post: 11-29-2008, 05:41 AM
  2. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  3. Password Problem
    By peckitt99 in forum Windows Programming
    Replies: 6
    Last Post: 11-13-2007, 02:13 AM
  4. Saving my Password in a file
    By Yuri in forum C++ Programming
    Replies: 29
    Last Post: 08-09-2005, 05:33 PM
  5. Random Password Generator v1.0 - download it
    By GaPe in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 08-18-2002, 01:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21