编制写一个IP的输入框,像windows中设置本地地址那种?0.0.0.0
解决方案 »
- 诚心请教这个单元在树中起到什么作用呢?
- delphi怎么调用java写的WebService ?
- 简单数学题,我循环时出错,给个代码参考下
- 在SQLSERVERZ中,BLOB能存什么,哪些是不能存的?
- 关于给StatusBar赋值的问题?
- (散分):BDE,ADO,dbExpress的前景如何?
- 请介绍一些delphi 报表制作方法和控件
- 程序在关闭时提示无效的窗口句柄,"1400 system error ",请问怎么回事?
- DELPHI6的注册号
- 请大家推荐一些Delphi5的书吧?开发人员指南已有了,mastering delphi 5 如何?
- 请教一个DLL的问题
- 100求数据库连接问题的解答:
function TCSForm.IsLegalIP(IP:string):boolean;
var
i, j, l: integer;
ips: array [1..4] of string;
begin
i:=1;
for l:=1 to 4 do ips[l]:='';
for j:=1 to length(ip) do
if ip[j]<>'.' then
begin
if (ip[j]<'0')or(ip[j]>'9') then
begin
//showmessage(ip[j]);
Result:=false;
exit;
end;
ips[i]:=ips[i]+ip[j]
end
else inc(i);
if (i<>4)
or((strtoint(ips[1])>255)or(strtoint(ips[1])<0)) //originally is <1
or((strtoint(ips[2])>255)or(strtoint(ips[2])<0))
or((strtoint(ips[3])>255)or(strtoint(ips[3])<0))
or((strtoint(ips[4])>255)or(strtoint(ips[4])<0)) then
Result:= false
else
Result:= true;
end;
下载来用了:)