Einzelnen Beitrag anzeigen

scp

Registriert seit: 31. Okt 2003
1.120 Beiträge
 
Delphi 7 Personal
 
#8

Re: F1, Werden meine Prots missbraucht?

  Alt 1. Jan 2004, 18:38
Zitat von SirThornberry:
Hab mal versucht das wichtigste C-Zeugs von dort (netstatp.c + netstatc.h) in Delphi zu übersetzen aber irgendwie komm ich nicht an die richtigen werte ran bzw weiß ich nicht wie ich die Dwords als ip darstellen kann und wie ich die ports richtig auslese... Vielleicht weiß ja jemand weiter..
Entweder so:
Delphi-Quellcode:
function dwIPToStr(dwIP : DWORD) : String;
begin
  result := IntToStr((dwIP ) and $FF) + '.' +
            IntToStr((dwIP shr 8) and $FF) + '.' +
            IntToStr((dwIP shr 16) and $FF) + '.' +
            IntToStr((dwIP shr 24) and $FF) ;
end;
...oder so:
Delphi-Quellcode:
function dwIPToStr(dwIP : DWORD) : String;
begin
  result := IntToStr((dwIP shr 24) and $FF) + '.' +
            IntToStr((dwIP shr 16) and $FF) + '.' +
            IntToStr((dwIP shr 8) and $FF) + '.' +
            IntToStr((dwIP ) and $FF) ;
end;
  Mit Zitat antworten Zitat