亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ping.pas

?? 包含常用Internet協(xié)議TCP,UDP、HTTP、FTP、Telnet等
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{*_* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Author:       Fran鏾is PIETTE
Description:  This unit encapsulate the ICMP.DLL into a VCL of type TPing.
              Using this object, you can easily ping any host on your network.
              Works only in 32 bits mode (no Delphi 1) under NT or 95.
              If you wants to build a console mode program, use the TICMP
              object. You'll have a much smaller program.
EMail:        http://users.swing.be/francois.piette  francois.piette@swing.be
              http://www.rtfm.be/fpiette             francois.piette@rtfm.be
              francois.piette@pophost.eunet.be
Creation:     January 6, 1997
Version:      1.11
Support:      Use the mailing list twsocket@rtfm.be See website for details.
Legal issues: Copyright (C) 1997 - 2000 by Fran鏾is PIETTE
              Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56
              <francois.piette@pophost.eunet.be>

              This software is provided 'as-is', without any express or
              implied warranty.  In no event will the author be held liable
              for any  damages arising from the use of this software.

              Permission is granted to anyone to use this software for any
              purpose, including commercial applications, and to alter it
              and redistribute it freely, subject to the following
              restrictions:

              1. The origin of this software must not be misrepresented,
                 you must not claim that you wrote the original software.
                 If you use this software in a product, an acknowledgment
                 in the product documentation would be appreciated but is
                 not required.

              2. Altered source versions must be plainly marked as such, and
                 must not be misrepresented as being the original software.

              3. This notice may not be removed or altered from any source
                 distribution.

              4. You must register this software by sending a picture postcard
                 to the author. Use a nice stamp and mention your name, street
                 address, EMail address and any comment you like to say.

Updates:
Nov 30, 1997 V1.00 Added DNSLookup capability (taken from TWSocket)
Dec 13, 1997 V1.01 Added OnEchoRequest and OnEchoReply events and removed the
             corresponding OnDisplay event. This require to modify existing
             programs.
May 05, 1998 V1.02 Changed lpszClassName from 'XSocketWindowClass' to
             'ICSPingWindowClass' to avoid class name conflict with TWSocket.
             Thanks to Bill Parke <econmodel@econmodel.com> who found the
             problem.
Dec 26, 1998 V1.10 Changed all events to make sender reference TPing object
             and added an argument 'Icmp' which point to the underlaying TIcmp
             object (this was the sender in previous version). This require
             modification of existing code.
Jan 24, 1999 V1.11 Surfaced Flags property to allow fragmentation check
             (Flags = $02 to enable fragmentation check)


 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit Ping;

{$IFDEF VER80}
// This source file is *NOT* compatible with Delphi 1 because it uses
// Win 32 features.
{$ENDIF}

interface

uses
  Windows, Messages, SysUtils, Classes, Winsock, Icmp;

const
  PingVersion           = 111;
  CopyRight : String    = ' TPing (c) 1997-2000 F. Piette V1.11 ';
  WM_ASYNCGETHOSTBYNAME = WM_USER + 2;

type
  TDnsLookupDone = procedure (Sender: TObject; Error: Word) of object;
  TPingDisplay   = procedure(Sender: TObject; Icmp: TObject; Msg : String) of object;
  TPingReply     = procedure(Sender: TObject; Icmp: TObject; Error : Integer) of object;
  TPingRequest   = procedure(Sender: TObject; Icmp: TObject) of object;
  TPing = class(TComponent)
  private
    FIcmp             : TICMP;
    FWindowHandle     : HWND;
    FDnsLookupBuffer  : array [0..MAXGETHOSTSTRUCT] of char;
    FDnsLookupHandle  : THandle;
    FDnsResult        : String;
    FOnDnsLookupDone  : TDnsLookupDone;
    FOnEchoRequest    : TPingRequest;
    FOnEchoReply      : TPingReply;
    FOnDisplay        : TPingDisplay;
  protected
    procedure   WndProc(var MsgRec: TMessage);
    procedure   WMAsyncGetHostByName(var msg: TMessage); message WM_ASYNCGETHOSTBYNAME;
    procedure   SetAddress(Value : String);
    function    GetAddress : String;
    procedure   SetSize(Value : Integer);
    function    GetSize : Integer;
    procedure   SetTimeout(Value : Integer);
    function    GetTimeout : Integer;
    function    GetReply : TIcmpEchoReply;
    function    GetErrorCode : Integer;
    function    GetErrorString : String;
    function    GetHostName : String;
    function    GetHostIP : String;
    procedure   SetTTL(Value : Integer);
    function    GetTTL : Integer;
    procedure   Setflags(Value : Integer);
    function    Getflags : Integer;
//    procedure   SetOnDisplay(Value : TICMPDisplay);
//    function    GetOnDisplay : TICMPDisplay;
//    procedure   SetOnEchoRequest(Value : TNotifyEvent);
//    function    GetOnEchoRequest : TNotifyEvent;
//    procedure   SetOnEchoReply(Value : TICMPReply);
//    function    GetOnEchoReply : TICMPReply;
    procedure   IcmpEchoReply(Sender: TObject; Error : Integer);
    procedure   IcmpEchoRequest(Sender: TObject);
    procedure   IcmpDisplay(Sender: TObject; Msg: String);
  public
    constructor Create(Owner : TComponent); override;
    destructor  Destroy; override;
    function    Ping : Integer;
    procedure   DnsLookup(HostName : String); virtual;
    procedure   CancelDnsLookup;

    property    Reply       : TIcmpEchoReply read GetReply;
    property    ErrorCode   : Integer        read GetErrorCode;
    property    ErrorString : String         read GetErrorString;
    property    HostName    : String         read GetHostName;
    property    HostIP      : String         read GetHostIP;
    property    Handle      : HWND           read FWindowHandle;
    property    DnsResult   : String         read FDnsResult;
  published
    property    Address     : String         read  GetAddress
                                             write SetAddress;
    property    Size        : Integer        read  GetSize
                                             write SetSize;
    property    Timeout     : Integer        read  GetTimeout
                                             write SetTimeout;
    property    TTL         : Integer        read  GetTTL
                                             write SetTTL;
    property    Flags       : Integer        read  Getflags
                                             write SetFlags;
    property    OnDisplay   : TPingDisplay   read  FOnDisplay
                                             write FOnDisplay;
    property    OnEchoRequest : TPingRequest read  FOnEchoRequest
                                             write FOnEchoRequest;
    property    OnEchoReply   : TPingReply   read  FOnEchoReply
                                             write FOnEchoReply;
    property    OnDnsLookupDone : TDnsLookupDone
                                             read  FOnDnsLookupDone
                                             write FOnDnsLookupDone;
  end;

procedure Register;

implementation


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure Register;
begin
    RegisterComponents('fpiette', [TPing]);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ This function is a callback function. It means that it is called by       }
{ windows. This is the very low level message handler procedure setup to    }
{ handle the message sent by windows (winsock) to handle messages.          }
function XSocketWindowProc(
    ahWnd   : HWND;
    auMsg   : Integer;
    awParam : WPARAM;
    alParam : LPARAM): Integer; stdcall;
var
    Obj    : TPing;
    MsgRec : TMessage;
begin
    { At window creation ask windows to store a pointer to our object       }
    Obj := TPing(GetWindowLong(ahWnd, 0));

    { If the pointer is not assigned, just call the default procedure       }
    if not Assigned(Obj) then
        Result := DefWindowProc(ahWnd, auMsg, awParam, alParam)
    else begin
        { Delphi use a TMessage type to pass paramter to his own kind of    }
        { windows procedure. So we are doing the same...                    }
        MsgRec.Msg    := auMsg;
        MsgRec.wParam := awParam;
        MsgRec.lParam := alParam;
        Obj.WndProc(MsgRec);
        Result := MsgRec.Result;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ This global variable is used to store the windows class characteristic    }
{ and is needed to register the window class used by TWSocket               }
var
    XSocketWindowClass: TWndClass = (
        style         : 0;
        lpfnWndProc   : @XSocketWindowProc;
        cbClsExtra    : 0;
        cbWndExtra    : SizeOf(Pointer);
        hInstance     : 0;
        hIcon         : 0;
        hCursor       : 0;
        hbrBackground : 0;
        lpszMenuName  : nil;
        lpszClassName : 'ICSPingWindowClass');


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Allocate a window handle. This means registering a window class the first }
{ time we are called, and creating a new window each time we are called.    }
function XSocketAllocateHWnd(Obj : TObject): HWND;
var
    TempClass       : TWndClass;
    ClassRegistered : Boolean;
begin
    { Check if the window class is already registered                       }
    XSocketWindowClass.hInstance := HInstance;
    ClassRegistered := GetClassInfo(HInstance,
                                    XSocketWindowClass.lpszClassName,
                                    TempClass);
    if not ClassRegistered then begin
       { Not yet registered, do it right now                                }
       Result := Windows.RegisterClass(XSocketWindowClass);
       if Result = 0 then
           Exit;
    end;

    { Now create a new window                                               }
    Result := CreateWindowEx(WS_EX_TOOLWINDOW,
                           XSocketWindowClass.lpszClassName,
                           '',        { Window name   }
                           WS_POPUP,  { Window Style  }
                           0, 0,      { X, Y          }
                           0, 0,      { Width, Height }
                           0,         { hWndParent    }
                           0,         { hMenu         }
                           HInstance, { hInstance     }
                           nil);      { CreateParam   }

    { if successfull, the ask windows to store the object reference         }
    { into the reserved byte (see RegisterClass)                            }
    if (Result <> 0) and Assigned(Obj) then
        SetWindowLong(Result, 0, Integer(Obj));
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Free the window handle                                                    }
procedure XSocketDeallocateHWnd(Wnd: HWND);
begin
    DestroyWindow(Wnd);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TPing.WndProc(var MsgRec: TMessage);
begin
     with MsgRec do begin
         if Msg = WM_ASYNCGETHOSTBYNAME then
             WMAsyncGetHostByName(MsgRec)
         else
             Result := DefWindowProc(Handle, Msg, wParam, lParam);
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TPing.WMAsyncGetHostByName(var msg: TMessage);
var
    Phe     : Phostent;
    IPAddr  : TInAddr;
    Error   : Word;
begin
    if msg.wParam <> LongInt(FDnsLookupHandle) then
        Exit;
    FDnsLookupHandle := 0;
    Error := Msg.LParamHi;
    if Error = 0 then begin
        Phe        := PHostent(@FDnsLookupBuffer);
        IPAddr     := PInAddr(Phe^.h_addr_list^)^;
        FDnsResult := StrPas(inet_ntoa(IPAddr));
    end;
    if Assigned(FOnDnsLookupDone) then
        FOnDnsLookupDone(Self, Error);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
constructor TPing.Create(Owner : TComponent);
begin
    Inherited Create(Owner);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久久久久漫画| 亚洲美女视频一区| 国产精品福利av| 麻豆精品视频在线| 色综合欧美在线| 久久久99精品免费观看不卡| 亚洲亚洲精品在线观看| 成人av资源在线观看| 精品少妇一区二区三区免费观看 | 日日夜夜免费精品| 不卡的电影网站| 久久久精品国产免大香伊| 午夜精品在线视频一区| 91丨九色丨蝌蚪富婆spa| 国产日韩一级二级三级| 九一九一国产精品| 欧美一区二区三区的| 亚洲综合久久av| 91在线无精精品入口| 国产三级一区二区三区| 国产精品一区二区免费不卡| 日韩欧美在线123| 日日骚欧美日韩| 欧美高清视频在线高清观看mv色露露十八| 国产精品大尺度| 日本成人超碰在线观看| 91精品久久久久久久91蜜桃| 日韩极品在线观看| 欧美一区二区在线不卡| 久久精品国产99国产| 91精品国产麻豆国产自产在线 | 日韩三级视频在线观看| 日韩av一级电影| 日韩午夜在线观看视频| 精品一区二区在线观看| 日韩女优视频免费观看| 韩国女主播成人在线观看| 久久综合久久鬼色中文字| 国产精品一区免费视频| 中文字幕乱码亚洲精品一区| 成人av集中营| 亚洲一区在线观看免费观看电影高清 | 亚洲高清不卡在线观看| 欧美日韩美女一区二区| 日韩成人av影视| 久久影音资源网| 日本在线播放一区二区三区| 日韩欧美中文字幕制服| 成人自拍视频在线观看| 亚洲免费观看高清| 6080日韩午夜伦伦午夜伦| 看电视剧不卡顿的网站| 国产精品视频yy9299一区| 色妹子一区二区| 欧美aa在线视频| 中文字幕日韩欧美一区二区三区| 色哟哟国产精品| 日本成人中文字幕| 国产日产精品1区| 欧美唯美清纯偷拍| 国产激情视频一区二区在线观看| 中文字幕制服丝袜成人av| 欧美色手机在线观看| 国产精品一区一区三区| 一区二区三区欧美| 精品卡一卡二卡三卡四在线| 91在线一区二区三区| 麻豆91精品91久久久的内涵| 亚洲三级在线观看| 精品av综合导航| 欧美综合色免费| 韩国成人在线视频| 亚洲国产精品一区二区www在线| 欧美成人精品二区三区99精品| 国产乱人伦偷精品视频不卡| 亚洲自拍都市欧美小说| 国产欧美一区二区精品婷婷| 91精品免费在线| 99精品国产99久久久久久白柏| 麻豆精品一区二区综合av| 亚洲三级在线免费观看| 国产视频一区在线播放| 欧美一区二区久久| 在线观看三级视频欧美| 国产盗摄女厕一区二区三区| 日韩1区2区3区| 亚洲一区在线免费观看| 日韩毛片在线免费观看| 国产日韩欧美精品电影三级在线 | 在线观看免费视频综合| 国产不卡高清在线观看视频| 免播放器亚洲一区| 天天色 色综合| 亚洲欧美综合另类在线卡通| 久久久久久久久久久久电影| 91麻豆精品国产91久久久久| 色综合久久99| 99精品欧美一区二区蜜桃免费| 国产一区二区免费看| 日av在线不卡| 青青草精品视频| 日韩成人伦理电影在线观看| 亚洲午夜三级在线| 亚洲欧美一区二区久久 | 国产午夜一区二区三区| 欧美一区二区福利在线| 337p亚洲精品色噜噜| 欧美日韩国产精品自在自线| 日本电影欧美片| 在线这里只有精品| 欧美这里有精品| 欧美日韩黄色一区二区| 欧美日韩国产a| 欧美视频你懂的| 制服丝袜av成人在线看| 91麻豆精品久久久久蜜臀| 日韩亚洲欧美成人一区| 精品国产三级电影在线观看| 欧美成人a∨高清免费观看| 精品伦理精品一区| 久久久久久99精品| 国产精品久久久久天堂| 亚洲免费观看视频| 午夜精品福利视频网站| 日本不卡123| 国产精品影视在线| 99久久精品免费看| 欧美色网站导航| 久久综合狠狠综合久久激情| 国产日产欧美一区二区三区| 亚洲欧洲无码一区二区三区| 一个色妞综合视频在线观看| 日韩av一区二区三区| 国产乱码一区二区三区| 成人app软件下载大全免费| 一本久久精品一区二区| 91麻豆精品国产自产在线 | 欧美二区三区91| 亚洲精品一区二区三区福利| 欧美国产综合一区二区| 亚洲小说欧美激情另类| 精品在线亚洲视频| 99久久国产免费看| 欧美一区二区三区四区五区 | 亚洲r级在线视频| 免费观看久久久4p| 成人黄色电影在线| 欧美片在线播放| 中文av一区特黄| 五月天激情综合| 国产ts人妖一区二区| 欧美日韩中文字幕精品| 国产亚洲综合色| 亚洲成人手机在线| 成人激情综合网站| 91精品国产综合久久精品性色| 国产精品沙发午睡系列990531| 天堂蜜桃91精品| 91老师片黄在线观看| 亚洲精品一区二区三区影院| 亚洲美女一区二区三区| 国产精品一级片| 欧美一区二区三区免费在线看| 亚洲四区在线观看| 久久99精品久久久久久久久久久久| 91网站在线观看视频| 精品国产区一区| 亚洲高清视频的网址| 91视频免费播放| 久久午夜羞羞影院免费观看| 婷婷成人激情在线网| 91麻豆免费视频| 国产亚洲欧美日韩日本| 免费成人av在线播放| 欧美日韩亚洲丝袜制服| 亚洲精品老司机| 99v久久综合狠狠综合久久| 久久美女艺术照精彩视频福利播放 | 国内久久精品视频| 欧美丰满少妇xxxxx高潮对白| 亚洲老妇xxxxxx| 91丨porny丨国产入口| 中文字幕第一页久久| 国产一区二区不卡| 久久久久久久网| 另类小说视频一区二区| 欧美一级夜夜爽| 免费一级欧美片在线观看| 欧美日韩国产在线播放网站| 亚洲综合成人网| 在线观看区一区二| 一区二区三区不卡在线观看| 色狠狠综合天天综合综合| 亚洲欧美电影院| 色婷婷精品久久二区二区蜜臀av| 国产精品国产三级国产aⅴ中文| 岛国精品在线观看| 国产农村妇女毛片精品久久麻豆 | 国产精品国产自产拍高清av王其 | 欧美丰满少妇xxxxx高潮对白|