我正在制作一个登录批处理文件。您可以登录。它是我的大批处理文件项目的一部分......但问题是当我注册并登录时它会给我我犯的错误,以防有人登录错误但我知道我的用户名和密码是正确的?任何人都可以编辑我的批处理文件,以便它顺利运行,并解释你为什么进行更改,以便我了解出了什么问题?继承人的代码。
@echo off
title LOG IN SCREEN v1.0
color 0a
if EXIST username.uf (
if EXIST password.uf (
goto Login
)) else (goto Reg)
:Reg
cls
echo Welcome to Register!
ping localhost 2 >nul
echo Register to continue
set /p U=Username:
set /p P=Password:
echo %U%>username.uf
echo %P%>password.uf
echo REGISTRATION COMPLETE!
pause
goto Login
:Login
cls
echo Welcome, Please Login to continue
set /p user=Username:
set /p pass=Password:
if %user%==username.uf (
if %pass%==username.uf (
goto welcome
)) else (goto error)
:welcome
cls
echo Welcome to the Test Program!
ping localhost -n 2 >nul
echo Please Exit and come back when you think
echo Program is up!
pause
exit
:error
cls
echo Error. Input Value = Incorrect
echo Error Code = .txt =/ u/p
ping localhost -n 2 >nul
echo Type goback to go back to previous screen
set /p er=
if %er%==goback goto Login
if not %er%==goback goto error