写了一些代码来实现注册登录重置和删除,但是删除一直有问题,求解- :login
- cd /d %~dp0
- title MICRODOS LOGIN ^& REGISTER
- setlocal enabledelayedexpansion
- if not exist urini.ini echo. >urini.ini
- cls
-
- :users2
- color 07
- cls
- echo.
- echo -------------------------
- echo MICRODOS LOGIN ^& REGISTER
- echo -------------------------
- echo.
- echo 1.Login
- echo.
- echo 2.register
- echo.
- echo 3.Reset users
- echo.
- echo 4.delete users
- echo.
- set /p a=Enter you choose:
- if /i "%a%"=="4" goto :delete4
- if /i "%a%" equ "3" (
- del urni.ini
- echo. >urini.ini
- cls
- echo RESET COMPLETE!
- pause>nul
- goto :users2
- ) else if /i "%a%" equ "2" (
- call :register
- goto :users2
- ) else if "%a%" equ "1" (
- set /p str1=Enter the USER NAME:
- set /p str2=Enter the password:
- findstr /x /c:"USER_NAME:!str1!_PASSWORD:!str2!" "urini.ini" 1>nul && (
- cls
- color 27
- echo TRUE!
- echo Please push any key to continue!
- pause>nul
- goto :dos
- ) || (
- cls
- color 47
- echo ERROR!
- echo Please push any key to continue!
- pause>nul
- goto :users2
- )
- ) else goto :users2
-
- :register
- cls
- :str1
- cls
- set "str1="
- set /p "str1=Enter the new user name:"
- if "x%str1%" equ "x" (
- echo Invalid user name.
- goto :str1
- )
-
- :str2
- cls
- set "str2="
- set /p "str2=Enter the new password:"
- if "x%str2%" equ "x" (
- echo Invalid password.
- goto :str2
- )
- >>"urini.ini" echo USER_NAME:%str1%_PASSWORD:%str2%
- goto :users2
-
- :delete4
- echo on
- echo What user do you want to delete:
- set /p ax=
- echo What the user %ax%'s password:
- set /p bx=
- findstr /x /c:"USER_NAME:%ax%_PASSWORD:%bx%" "urini.ini" 1>nul
- for /f %%i in (urini.ini) do ( set "url=%%i"
- set url="USER_NAME:%ax%_PASSWORD:%bx%"
-
- )<nul >>"urini(2).ini"
- pause
- del urini.ini
- ren "urini(2).ini" "urini.ini"
- cls
- echo DELETE COMPLETE!
- pause>nul
- goto :users2
复制代码 有无大佬可以完美解决,在以上的源码的前提下实现的,非常感谢 |