0

所以我有这个代码

@echo off  
set /p pass=Input Pass:  
call rig.txt   
if %pass%==rig.txt goto right  
goto wrong  
:wrong  
echo Authentication Failed!  
pause  
exit  
:right  
echo correct  
pause  

所以不要有这样的东西

@echo off  
set /p pass=Input Pass:  
if %pass%==randompassword goto right  
goto wrong  
:wrong  
echo Authentication Failed!  
pause  
exit  
:right  
echo correct  
pause 

我试图得到它,所以它调用 rig.txt 里面有我的密码并检查我是否输入了正确的密码。请帮忙!

4

1 回答 1

0
@echo off  

rem Read right password saved in rig.txt file
set /P rightPass=< rig.txt

set /p pass=Input Pass:  
if %pass% == %rightPass% goto right  
echo Authentication Failed!  
pause  
exit  

:right  
echo correct  
pause 
于 2013-06-06T01:25:14.107 回答