亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
色婷婷av一区二区三区软件 | 国产一区二区0| 韩国毛片一区二区三区| 国产精品一区二区视频| 99re热这里只有精品视频| 99国产精品久久久久| 欧美日韩精品欧美日韩精品一| 日韩免费高清av| 国产精品久久毛片av大全日韩| 亚洲成av人片在线观看无码| 国产精品一二一区| 欧美午夜在线观看| www久久久久| 亚洲无线码一区二区三区| 国产一区二区三区黄视频| 欧美在线啊v一区| 精品av综合导航| 有坂深雪av一区二区精品| 久久99精品网久久| 在线看国产一区| 欧美精品一区二区久久久| 亚洲男人的天堂在线aⅴ视频| 久久99国产精品免费| 91黄色免费版| 日本一区二区高清| 日韩成人一区二区三区在线观看| gogo大胆日本视频一区| 日韩精品一区二区三区视频播放 | 床上的激情91.| 91精品免费在线观看| 亚洲日本一区二区| 国产精品18久久久| 日韩欧美一卡二卡| 亚洲成人免费在线| 91丨九色丨国产丨porny| 久久久综合九色合综国产精品| 亚洲国产成人porn| 91亚洲精品久久久蜜桃| 久久免费看少妇高潮| 奇米777欧美一区二区| 欧美亚洲国产一区二区三区va | 欧美精品1区2区| 一区精品在线播放| 国产麻豆一精品一av一免费 | 久久99精品国产91久久来源| 欧美色手机在线观看| 最新国产の精品合集bt伙计| 国产精品99久久久久| 在线综合视频播放| 亚洲午夜精品网| 色婷婷av一区二区三区gif| 国产精品免费久久久久| 国产精品18久久久久久久网站| 欧美一区二区大片| 日精品一区二区| 91官网在线观看| 亚洲日本中文字幕区| 菠萝蜜视频在线观看一区| 久久精品视频网| 国产一区二区三区久久久| 精品国产一区二区三区久久久蜜月 | 美女视频网站久久| 91精品国产乱| 日本成人在线网站| 欧美精品123区| 视频一区视频二区在线观看| 欧美日韩国产美| 亚洲va韩国va欧美va| 欧美亚洲一区二区三区四区| 亚洲最色的网站| 色视频成人在线观看免| 一区二区三区精品视频| 一本一道波多野结衣一区二区| 亚洲免费视频成人| 色悠久久久久综合欧美99| 亚洲欧美激情在线| 91久久一区二区| 一区二区三区不卡在线观看 | 中文字幕亚洲区| 91网址在线看| 夜夜夜精品看看| 欧美精品在线视频| 美女网站色91| 国产性天天综合网| 97久久超碰国产精品| 亚洲精品视频在线| 欧美精品一级二级| 久久99精品网久久| 国产精品―色哟哟| 日本伦理一区二区| 午夜精品福利在线| 日韩欧美国产小视频| 粉嫩av亚洲一区二区图片| **性色生活片久久毛片| 欧美色区777第一页| 麻豆一区二区在线| 中文字幕精品—区二区四季| 91蝌蚪porny成人天涯| 亚洲亚洲精品在线观看| 一区二区三区精品在线| 欧美人与z0zoxxxx视频| 国产综合色在线| 一区在线播放视频| 欧美精品在欧美一区二区少妇| 激情小说亚洲一区| 国产精品久久精品日日| 欧美欧美午夜aⅴ在线观看| 国产原创一区二区三区| 亚洲欧美一区二区三区孕妇| 欧美电影在线免费观看| 国产精品影视网| 一区二区三区四区亚洲| 日韩欧美精品在线视频| www.欧美色图| 奇米888四色在线精品| 国产欧美一区二区三区沐欲 | 亚洲一区欧美一区| 日韩欧美国产综合一区| www.在线成人| 日韩成人一级片| 国产精品久久久久久福利一牛影视| 欧美乱熟臀69xxxxxx| 国产99久久久国产精品潘金网站| 亚洲国产欧美另类丝袜| 国产午夜精品美女毛片视频| 精品视频1区2区3区| 国产91精品一区二区| 亚洲va欧美va人人爽午夜| 国产精品―色哟哟| 日韩亚洲欧美成人一区| 99国内精品久久| 狠狠色综合播放一区二区| 亚洲小说欧美激情另类| 中文字幕乱码一区二区免费| 日韩一区二区三| 在线免费精品视频| 国产999精品久久久久久| 日本91福利区| 一区二区三区在线播| 国产日韩欧美麻豆| 91精品国产品国语在线不卡| 色婷婷综合中文久久一本| 国产一级精品在线| 日韩经典一区二区| 亚洲欧美国产毛片在线| 欧美激情一区二区三区| 欧美电视剧在线观看完整版| 在线免费观看日本欧美| 成人一区二区三区在线观看| 精品一区二区三区免费毛片爱| 亚洲国产日韩a在线播放| 亚洲视频免费看| 国产精品免费视频一区| www国产成人| 日韩欧美在线综合网| 欧美日韩一区二区三区四区五区| 9i看片成人免费高清| 国产在线观看一区二区| 秋霞成人午夜伦在线观看| 亚洲444eee在线观看| 亚洲激情自拍视频| 中文字幕欧美一区| 国产精品伦理一区二区| 亚洲国产成人在线| 久久久天堂av| 欧美精品一区二区高清在线观看| 日韩一区二区三区av| 91精品国产麻豆| 欧美一级理论片| 一区二区高清在线| 亚洲私人黄色宅男| 国产精品色哟哟网站| 欧美激情一区二区| 国产欧美日韩精品一区| 欧美激情一区在线| 欧美国产综合色视频| 中文字幕精品一区| 国产精品久久三| 日韩美女视频19| 玉足女爽爽91| 亚洲观看高清完整版在线观看| 亚洲精品一二三| 亚洲一区二区三区中文字幕在线| 亚洲午夜电影在线观看| 五月天一区二区三区| 亚洲bt欧美bt精品777| 五月天网站亚洲| 视频一区二区三区中文字幕| 青青国产91久久久久久| 久久成人精品无人区| 精品一区二区三区免费| 久久99精品久久久久久国产越南| 国产自产2019最新不卡| 国产精品91一区二区| 粉嫩av亚洲一区二区图片| www.亚洲在线| 欧美在线不卡一区| 51午夜精品国产| 精品成人a区在线观看| 国产欧美一区二区精品性色超碰|