|

楼主 |
发表于 2008-1-31 22:01:00
|
显示全部楼层
Re: Delphi版传奇SelGate 加载IP过滤列表错误
procedure LoadBlockIPFile();
var
I: Integer;
sFileName:String;
LoadList:TStringList;
sIPaddr:String;
nIPaddr:Integer;
IPaddr :pTSockaddr;
begin
sFileName:='.\BlockIPList.txt';
if FileExists(sFileName) then begin
LoadList:=TStringList.Create;
LoadList.LoadFromFile(sFileName);
for I := 0 to LoadList.Count - 1 do begin
sIPaddr:=Trim(LoadList.Strings[0]);
if sIPaddr = '' then Continue;
nIPaddr:=inet_addr(PChar(sIPaddr));
if nIPaddr = INADDR_NONE then Continue;
New(IPaddr);
FillChar(IPaddr^,SizeOf(TSockaddr),0);
IPaddr.nIPaddr:=nIPaddr;
BlockIPList.Add(IPaddr);
end;
LoadList.Free;
end;
end;
怎么会只能加载第行呢??
|
|