这个代码不是很全啊
给你一个不错的全代码
@echo off
setlocal
set times=2 /*这个地方 是设定输入帐户和密码核定的次数*/
title login 显示文本
:login
set /P user=username:
if %user%==sniper goto password /*如果帐户名为sniper则跳到password处*/
:check rem /*验证部分*/
title check
echo 输入错误,请重新输入,您还有%times%次机会
set /A times=%times%-1 /*次数计算*/
if %times%==0 goto log /*times等于0时到log处 */
goto login
:log rem /*日志记录部分*/
title log
echo time:%time% date:%date%>log.txt
echo ip:>>log.txt
netstat -n|find "ESTABLISHED">>log.txt
set /P msg=username is wrong ,please leave your message:
echo message:>>log.txt
echo %msg%>>log.txt
echo goodbye
pause
exit
:password
:set /P Passwd=password: /*密码比对部分*/
if %passwd%==sniper goto welcome
goto check
:welcome
cls
ver
cmd /D |