1.当然是包含头文件:
uses
JclStrHashMap
2.声明:
FCacheHash: TStringHashMap;
3.创建实例:
FCacheHash := TStringHashMap.Create(CaseInsensitiveTraits, 255);
4.加入item:
FCacheHash.Add(AIp,Item);
5.遍历:
FCacheHash.IterateMethod(nil, IterateTel);
function TFrmSend.IterateTel(AUserData: PUserData; const AStr: string;
var Ptr: PData): Boolean;
begin
Result := True;
if IsMobile(AStr) then
FMobileList.Add(AStr)
else if IsUnicom(AStr) then
FUnicomList.Add(AStr)
else if IsTelecom(AStr) then
FTelecomList.Add(AStr);
end;