Saturday 13 July 2013

Secure Login+Register


Batch Secure Login+Register

Here is the code.
By Mustafac
@echo off
IF EXIST Username.uf (
IF EXIST Password.uf (
Goto Login
)) ELSE (Goto Reg)
:Reg
Title Register
Echo REGISTERATION
Echo:
set /p U=Username:
set /p P=Password:
Echo %P%>password.uf
Echo %U%>username.uf
Echo Registeration Complete!
Echo Press any key
Pause>nul

:Login
cls
setlocal
set User2=
for /f "tokens=*" %%a in ('type username.uf 2^>NUL') do set User2=%%a
set Pass2=
for /f "tokens=*" %%a in ('type password.uf 2^>NUL') do set Pass2=%%a
:Loginp2
Title Log in
cls
Echo Log in
Echo:
set /p user= Username:
set /p pass= Password:
if /i %user% equ %User2% (
if /i %pass% equ %Pass2% (
goto W
)
) else (goto IC)

:IC
cls
echo The Password/Username was incorrect please try again
Echo:
Echo Press any key
Pause>nul
goto Login

:W
cls
Title Example
Echo Welcome to the example Program!
echo Press any key to exit!
Pause>nul
Hi. Here are some of my batch codes.
Here is a simple talk one.
@echo off
color 0c
Title Talk
Echo Hi whats your name?
set /p name= My  name is
Echo Ok how old are you?
set /p age= I am (years old)
Echo Your name is %name% and your %age% years old? OK! By the way my name is... Hey whats my name again? I know YOU CHOOSE!!!
set /p mn = My name is
Echo Hey thanks %name% bye for now.
Echo Press any letter/number on your keyboard to continue.
pause>nul