ping pod vista

0

Witam,

Znacie jakis sposob na wyslanie ping'a ktory by dzialal pod systemem Vista?
Do tej pory uzywalem biblioteki icmp.dll, ale to rozwiazanie nie dziala pod Vista.

0

http://msdn.microsoft.com/en-us/library/aa366050.aspx

Zwróć uwagę na ten fragment:

MSDN napisał(a)

The IcmpSendEcho function is exported from the Icmp.dll on Windows 2000. The IcmpSendEcho function is exported from the Iphlpapi.dll on Windows XP and later. OS version checking is not recommended to use this function. Applications requiring portability with this function across Windows 2000, Windows XP, Windows Server 2003 and later Windows versions should not statically link to either the Icmp.lib or the Iphlpapi.lib file. Instead, the application should check for the presence of IcmpSendEcho in the Iphlpapi.dll with calls to LoadLibrary and GetProcAddress. Failing that, the application should check for the presence of IcmpSendEcho in the Icmp.dll with calls to LoadLibrary and GetProcAddress.

0

Dzieki za info, to pewnie wlasnie to.
Ma ktos przykladowy kod w Delphi jak to powinno wygladac?

Pozdrawiam

0
Lib := LoadLibrary('Iphlpapi.dll');
if Lib <> nil then
begin
  Func := GetProcAddress(Lib,'IcmpSendEcho');
  if Func <> nil then
    Func(...);
  FreeLibrary(Lib);
end;

Zmodyfikuj to sobie tak, aby uwzględnić to co napisali na MSDN.

1 użytkowników online, w tym zalogowanych: 0, gości: 1