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

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

?? ping.pas

?? 包含常用Internet協議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一区二区三区免费野_久草精品视频
欧洲一区在线观看| 不卡一区二区三区四区| 欧美疯狂做受xxxx富婆| 亚洲午夜久久久久久久久电影院| 99久久亚洲一区二区三区青草| 1区2区3区精品视频| 一本大道久久精品懂色aⅴ| 夜夜亚洲天天久久| 91精品婷婷国产综合久久性色| 日韩av一区二区在线影视| 精品福利二区三区| 大桥未久av一区二区三区中文| 国产精品久久777777| 色老汉av一区二区三区| 五月婷婷激情综合| 亚洲精品一线二线三线| 成人影视亚洲图片在线| 一区二区三区欧美在线观看| 精品视频一区 二区 三区| 精品国产一区二区三区忘忧草| 欧美一二区视频| 国产999精品久久| 国产精品嫩草影院com| 一本一道综合狠狠老| 日日摸夜夜添夜夜添亚洲女人| 欧美大片免费久久精品三p| 丁香啪啪综合成人亚洲小说| 亚洲男女毛片无遮挡| 欧美欧美欧美欧美| 国产aⅴ精品一区二区三区色成熟| **性色生活片久久毛片| 日韩一区二区精品在线观看| 国产精品18久久久久久久久| 亚洲一区二区五区| 2023国产精品自拍| 日本韩国一区二区三区| 久久国内精品视频| 亚洲精品日韩一| 久久综合狠狠综合久久综合88| 91一区二区三区在线观看| 卡一卡二国产精品| 亚洲精品水蜜桃| 久久久精品一品道一区| 欧美高清视频不卡网| 99在线精品视频| 激情伊人五月天久久综合| 一区二区三区精品| 中文字幕国产一区| 日韩午夜激情电影| 欧美中文字幕不卡| 成人精品gif动图一区| 青青草精品视频| 亚洲综合丝袜美腿| 国产精品国产三级国产aⅴ原创| 欧美一级视频精品观看| 91福利精品第一导航| 国产福利不卡视频| 奇米精品一区二区三区在线观看一| 成人欧美一区二区三区| 国产三级精品视频| 精品国产乱码久久久久久闺蜜| 欧美日韩色一区| 在线观看日韩精品| av一区二区不卡| 成人在线综合网站| 韩国欧美国产1区| 精品一区二区三区在线观看国产| 石原莉奈在线亚洲三区| 亚洲黄色小视频| 久久精品男人天堂av| 日韩精品一区二区三区视频| 欧美一区二区三区视频免费播放 | 色综合久久久久久久| 国产一区二区导航在线播放| 日本网站在线观看一区二区三区| 亚洲国产综合人成综合网站| 亚洲综合色丁香婷婷六月图片| 一区二区三区加勒比av| 亚洲激情五月婷婷| 亚洲一区电影777| 成人午夜电影网站| 国产裸体歌舞团一区二区| 精品一区二区三区日韩| 国产一区二区三区四区五区美女| 国产综合一区二区| 国产成人av资源| 成人18视频日本| 在线精品视频一区二区| 欧美三级日韩三级| 欧美一区二区三区四区五区| 日韩欧美久久久| 国产亚洲一区二区在线观看| 国产日韩欧美a| 国产精品久久综合| 亚洲一区在线视频| 日韩在线一区二区| 国产一区二区剧情av在线| 成人一级片在线观看| 日本韩国视频一区二区| 56国语精品自产拍在线观看| 欧美videos大乳护士334| 久久婷婷国产综合精品青草| 中文字幕av免费专区久久| 亚洲黄一区二区三区| 蜜臀av一区二区| 成人听书哪个软件好| 91成人在线免费观看| 日韩欧美综合一区| 国产女人18水真多18精品一级做 | 国产精品一区二区久久精品爱涩| 成人永久免费视频| 欧美日韩精品电影| 久久视频一区二区| 亚洲猫色日本管| 捆绑调教美女网站视频一区| 99久久久精品免费观看国产蜜| 欧美日韩综合在线免费观看| 国产亚洲福利社区一区| 亚洲蜜桃精久久久久久久| 老鸭窝一区二区久久精品| 99re视频这里只有精品| 欧美一区二区三区性视频| 国产精品美女视频| 人人狠狠综合久久亚洲| 成人av集中营| 日韩欧美国产综合一区| 一区二区日韩电影| 国产一区二区成人久久免费影院| 在线精品视频一区二区三四| 国产色一区二区| 日韩av在线播放中文字幕| 91亚洲永久精品| 精品成人免费观看| 亚洲综合一二区| 成人性色生活片免费看爆迷你毛片| 欧美日韩久久久久久| 中文字幕亚洲一区二区av在线| 麻豆成人免费电影| 在线一区二区三区做爰视频网站| 久久蜜桃av一区精品变态类天堂| 国产精品资源在线观看| 久久久久久久久蜜桃| 国产一区二区不卡在线| 日韩欧美一区电影| 国产成人夜色高潮福利影视| 欧美网站一区二区| 国产午夜精品久久| 美脚の诱脚舐め脚责91| 欧美日韩亚洲高清一区二区| 亚洲视频在线观看一区| 国产成人免费视频精品含羞草妖精| 正在播放亚洲一区| 亚洲欧美日韩一区二区 | 337p日本欧洲亚洲大胆色噜噜| 亚洲自拍欧美精品| 99久久99久久精品免费观看| 国产视频视频一区| 国产毛片精品视频| 亚洲精品在线网站| 精品一区中文字幕| 亚洲精品一线二线三线无人区| 奇米影视一区二区三区| 欧美一区二区三区影视| 日韩不卡手机在线v区| 欧美军同video69gay| 五月激情六月综合| 欧美日韩一区二区三区视频| 成人性生交大片免费| 日本高清无吗v一区| 欧美日韩免费电影| 国产日本欧美一区二区| 色婷婷综合五月| 精品第一国产综合精品aⅴ| 亚洲自拍偷拍图区| 欧美日韩三级视频| 天堂久久一区二区三区| 91麻豆精品国产91久久久久久久久 | 一本到高清视频免费精品| 亚洲青青青在线视频| 色88888久久久久久影院野外| 亚洲美女电影在线| 欧美精品视频www在线观看| 日本伊人色综合网| 日韩午夜精品电影| 精品一区免费av| 中文字幕av不卡| 91久久免费观看| 奇米亚洲午夜久久精品| 久久综合色8888| 91精品国产一区二区人妖| 5月丁香婷婷综合| 国产一区视频在线看| 久久色视频免费观看| 成人国产精品免费观看| 亚洲精品乱码久久久久久| 久久中文娱乐网| 色婷婷综合久久久久中文一区二区 | 国产麻豆精品95视频| 一色屋精品亚洲香蕉网站| 欧美日韩一级二级|