Giter Site home page Giter Site logo

alfuguo / user-validation-with-csv-file Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

User Validation with CSV -- Build a Java console application for user login validation using data from a CSV file. Utilize a User POJO class and a UserService class for logic. Implement a login screen, check user credentials, and handle invalid login attempts with a maximum of 5 tries.

Java 100.00%
csv-import csv-parser java login poj

user-validation-with-csv-file's Introduction

User Validation System Introduction

This Java application demonstrates a simple user validation system that reads user information from a file, allows users to log in with their credentials, and provides feedback on the login status. The user data is stored in a text file named data.txt in a comma-separated format.

Installation Clone the repository:

bash git clone <repository_url> Navigate to the project directory:

bash cd user-validation-system Compile and run the UserApplication class:

bash javac userValidation/UserApplication.java java userValidation.UserApplication Usage The application will prompt you to enter your username and password. You have up to 5 attempts to log in. If the login is successful, it will display a welcome message with the user's name. If the login fails, it will notify you of an invalid login, and you can try again. After 5 failed attempts, you will be locked out. Code Overview UserService Class readFile(): Reads user information from the data.txt file and creates an array of User objects. createUser(): Creates a User object with the provided username, password, and name. validateUser(): Validates user credentials against the stored user data. userLogin(): Initiates the user login process by reading user data, prompting for credentials, and handling login attempts. UserApplication Class main(): Entry point of the application, creates a UserService instance, and initiates the user login process. User Class Represents a user with properties: username, password, and name. Provides getter and setter methods for each property. File Format (data.txt) The data.txt file contains user information in the following format:

[email protected],passwordTest!1,Test User

[email protected],asdfasdf,Another User

[email protected],Hdk398jf!,John Doe

[email protected],sunrise-sunset,Jane Doe

Each line corresponds to a user record with comma-separated values for username, password, and name.

user-validation-with-csv-file's People

Contributors

alfuguo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.