亲宝软件园·资讯

展开

ip 批处理 检测ip格式是否正确的批处理

人气:0
想了解检测ip格式是否正确的批处理的相关内容吗,在本文为您仔细讲解ip 批处理的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:ip,批处理,下面大家一起来学习吧。

复制代码 代码如下:

@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

加载全部内容

相关教程
猜你喜欢
用户评论