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

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

?? ping.~pas

?? ping控件
?? ~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)
Nov 10, 2002 V1.12 Changed argument name from Error to Status in OnEchoReply
             to better reflect his use. 0 means OK !


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

{$IFDEF VER80}
// This source file is *NOT* compatible with Delphi 1 because it uses
// Win 32 features.
{$ENDIF}
{*.dcr}
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; Status : 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费高清在线视频一区·| 亚洲日本护士毛茸茸| 欧美精品自拍偷拍| 日韩精品一区二区三区视频播放| 91精品国产福利在线观看| 欧美一区二区三区精品| 中文天堂在线一区| 亚洲一区二区三区激情| 久久精品国产99久久6| 亚洲精品v日韩精品| 亚洲精品中文字幕乱码三区| 亚洲精品菠萝久久久久久久| 久久久99精品免费观看不卡| 久久久精品一品道一区| 国产精品一区不卡| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 日韩一二在线观看| 欧美日韩你懂得| 亚洲黄色免费网站| 亚洲地区一二三色| 国产一区二区三区在线观看精品| 国产成人免费高清| 日韩欧美一区二区不卡| 久久亚洲欧美国产精品乐播 | 欧美无砖砖区免费| av电影在线观看一区| 欧美一区二区在线播放| 国产精品伦理在线| 午夜精品久久久久久久久久| 国产精品香蕉一区二区三区| 欧美日韩国产美女| 亚洲精品日日夜夜| 白白色 亚洲乱淫| 国产女同性恋一区二区| 国产乱码精品一品二品| 欧美va天堂va视频va在线| 亚洲午夜在线视频| 在线精品视频免费观看| 自拍偷拍欧美激情| 成人av中文字幕| 亚洲美女屁股眼交| 91麻豆高清视频| 亚洲一区日韩精品中文字幕| 在线亚洲高清视频| 午夜av电影一区| 777xxx欧美| 美女在线一区二区| 国产亚洲人成网站| 91丝袜美腿高跟国产极品老师 | 成人18精品视频| 亚洲综合色噜噜狠狠| 制服丝袜亚洲网站| 国内精品久久久久影院薰衣草| 欧美韩国日本综合| 在线观看网站黄不卡| 日本不卡一二三| 国产精品久久久久久久久快鸭| 在线观看日产精品| 国产精品一区二区x88av| 亚洲视频一区二区在线观看| 欧美一区二区观看视频| 成人黄色片在线观看| 日本伊人精品一区二区三区观看方式 | 欧美日韩一区精品| 成人激情文学综合网| 日韩av网站在线观看| 亚洲精品国产精华液| 欧美极品xxx| 2020国产精品自拍| 欧美精品久久99久久在免费线 | 日韩影院免费视频| 亚洲美女精品一区| 国产精品久久久久久久久图文区| 日韩午夜av一区| 日韩亚洲欧美在线| 精品国产凹凸成av人导航| 欧美不卡一区二区三区| 91国在线观看| 91麻豆国产在线观看| 国产成人一区二区精品非洲| 久久激五月天综合精品| 亚洲成人tv网| 亚洲综合色区另类av| 亚洲国产日韩在线一区模特| 亚洲欧洲三级电影| 亚洲精品日日夜夜| 亚洲综合久久久| 丝袜亚洲另类欧美综合| 亚洲在线视频免费观看| 国产精品久久久久一区二区三区共 | 成人av资源站| 91久久国产综合久久| 欧美三区在线观看| 欧美一区日韩一区| 国产无一区二区| 亚洲精品日韩专区silk| 午夜成人免费视频| 国产伦精品一区二区三区在线观看 | 亚洲精品高清在线观看| 亚洲在线视频一区| 国内精品不卡在线| 99精品在线免费| 欧美一区二区三区啪啪| 国产精品久久影院| 日韩电影一二三区| 99精品偷自拍| 欧美激情一区二区在线| 91丨porny丨首页| 青青草97国产精品免费观看 | 青青青爽久久午夜综合久久午夜| 床上的激情91.| 国产亚洲欧美一级| 热久久国产精品| 91精品国产欧美一区二区| 亚洲精品一二三| 一本大道久久a久久综合婷婷| 久久久不卡网国产精品二区 | 欧美mv日韩mv亚洲| 国产一区三区三区| 3d成人动漫网站| 久久视频一区二区| 亚洲欧美日韩精品久久久久| 欧美aaaaa成人免费观看视频| 国内精品国产成人| 色综合久久久久久久久久久| 欧美撒尿777hd撒尿| 久久综合九色综合欧美98| 日韩精品五月天| 成人免费毛片app| 国产亚洲精品7777| 国精产品一区一区三区mba视频| 欧美麻豆精品久久久久久| 亚洲大尺度视频在线观看| 国产精品第四页| 风间由美一区二区av101| 欧美一区二区网站| 狠狠狠色丁香婷婷综合久久五月| 91精品国产麻豆国产自产在线 | 国产亚洲精品中文字幕| 欧美日本乱大交xxxxx| 国产精品美女www爽爽爽| a级高清视频欧美日韩| 亚洲精品五月天| 欧美性欧美巨大黑白大战| 亚洲一区二区三区激情| 欧美一级片在线| 成人午夜视频网站| 五月天丁香久久| 中文字幕av一区二区三区高 | 欧美r级在线观看| 91丨porny丨户外露出| 奇米精品一区二区三区四区 | 久久国产麻豆精品| 中文字幕亚洲成人| 91精品国产综合久久小美女| 日本在线不卡视频一二三区| 国产精品欧美一区二区三区| 欧美视频一区二区在线观看| 精品在线播放免费| 天天操天天色综合| 亚洲va国产va欧美va观看| 国产精品久久久久久一区二区三区 | 国产99久久久国产精品潘金网站| 日韩理论电影院| 中文幕一区二区三区久久蜜桃| 欧美日韩免费不卡视频一区二区三区 | 亚洲大型综合色站| 亚洲综合一区二区三区| 中文字幕亚洲视频| 久久久午夜精品理论片中文字幕| 制服丝袜中文字幕一区| 欧美美女黄视频| 日韩欧美不卡在线观看视频| 欧美岛国在线观看| 欧美一区午夜视频在线观看| 欧美一区二区精美| 精品免费国产一区二区三区四区| 欧美日韩小视频| 精品国产一二三| 国产精品国产a级| 一区av在线播放| 视频在线观看91| 久久成人久久爱| 国产伦精品一区二区三区免费 | 777a∨成人精品桃花网| 日韩三级伦理片妻子的秘密按摩| 日韩精品中文字幕在线一区| 日韩一区二区三区四区五区六区| 日韩欧美在线123| 欧美mv和日韩mv国产网站| 国产午夜亚洲精品午夜鲁丝片| 日韩一区欧美一区| 热久久一区二区| 成人免费视频一区| 欧美日韩一区视频| 精品国产自在久精品国产| 国产精品高清亚洲| 日韩vs国产vs欧美| 色呦呦日韩精品| 欧美日韩亚洲国产综合|