医疗信息,心机面膜,babystar
@echo off
:: 检测ip格式是否标准
:: code by jm 2006-10-23
:begin
cls
set input=
set /p input=请输入ip:
echo %input%|findstr "^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*$">nul||goto fail
set _input=%input:.= %
call :check %_input%
:check
if "%4"=="" goto fail
for %%i in (%1 %2 %3 %4) do (
if %%i gtr 255 goto fail
)
cls
echo %input% 是正确的ip
echo.
pause
goto begin
:fail
cls
echo %input% 是错误的ip
echo.
pause
goto begin
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
批处理ren重命名的方式
批处理之ren命令-可批量修改文件名1.批处理批量修改文件后缀名(假设我需要把一个文件夹中的很多txt文件改为sql文件): 1)在需要被处理的文件的文件夹里先...
[阅读全文]
-
-
-
-
-
-
-
-
-
网友评论