
求助批處理動態密碼問題各位大神好!如各位大神有能力請幫忙做個批處理:一次生成三個密碼(5位數),三個密碼生成時保存時間到配置文件中,結束時間是1小時(下次打開的時候時間相差大于等于一小時重換密碼,三個密碼用哪個都行,一個密碼只能用1次,,不能用的加入黑名單配置文件中)不是我不想做,不練,不寫,是真的因為本人代碼風格笨拙,也沒有能力!以下貼出本人代碼(不要運行,也不要改)
nclick="copycode($('code0'));">復制代碼
- @echo off
- Setlocal EnableDelayedExpansion
- setlocal enableextensions
- :lodd
- if not exist conf.ini goto hua
- if not exist pwd goto hua
- set tme=%date:~0,4%%date:~5,2%%date:~8,2%
- call :line conf.ini Date tmp
- call :line conf.ini MaxER tmp1
- call :read2 tmp
- call :read3 err
- call :read1 tmp1
- echo %max% %ec% %wct%
- pause
- if %ec% GEQ %tme% set/a %wct%+1=wct
- if %wct% GTR %max% exit
- goto main
- :main
- echo %wct%>err
- echo.
- echo.
- echo 動態密碼/11/16 失效
- echo.
- echo.
- pause
- cls
- echo.
- set/p ab=密碼:
- call :pwd %ab% pwd
- goto main
- :line
- (for /f delims= %%a in (%1) do (
- set str=%%a
- if !str:~,1!==[ (
- if %%a==[%2] (
- set n=true
- ) else (
- set n=
- )
- ) else if defined n (
- echo,%%a
- )
- ))>%3
- goto :eof
- :hua
- if exist pwd del pwd /s /q /f >nul
- echo %random%-%random%-%random%>pwd
- ECHO 完成.
- goto lodd
- :pwd
- cd /d %~dp0
- set return=NotFound
- set input=Nothing
- set input=%1
- for /f delims=: %%i in ('type %2 ^| findstr /n /l /x /c:%input%') do (
- set return=%%i
- )
- if %rerurn%==NotFound goto main
- if %input%==Nothing goto main&set /a wct=%wct%+1
- call :del %return%
- goto install
- :del
- for /f delims= %%i in ('%1') do (
- (set n=0
- for /f delims= %%j in ('type %%i') do (
- set /a n+=1
- if not !n!==1 echo %%j
- ))>$
- move $ %%i>nul
- )
- :read1
- for /f delims= %%i in (%1) do (
- set max=%%i
- )
- goto :eof
- :read2
- for /f delims= %%m in (%1) do (
- set ec=%%i
- )
- goto :eof
- :read3
- for /f delims= %%b in (%1) do (
- set wct=%%i
- )
- goto :eof
- :err
- echo.
- echo 不能找到文件!
- pause>nul
- exit
- :install
- pause
- exit

