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

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

?? httpthr1.pas

?? 文件名稱:新曦 我的資源 搜索軟件 源程序(Borland Delphi 7)說明
?? PAS
字號:
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Author:       Fran鏾is PIETTE (From a work done by Ed Hochman <ed@mbhsys.com>)
Creation:     Jan 13, 1998
Version:      1.00
Description:  HttpThrd is a demo program showing how to use THttpCli component
              in a multi-threaded program.
EMail:        francois.piette@pophost.eunet.be    
              francois.piette@rtfm.be             http://www.rtfm.be/fpiette
Support:      Use the mailing list twsocket@rtfm.be See website for details.
Legal issues: Copyright (C) 1997, 1998 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.

Updates:

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit HttpThr1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  HttpProt, StdCtrls, IniFiles;


type
  TThreadState = (tsInexistant, tsReady, tsInUse);

  THttpThreadForm = class(TForm)
    URLEdit: TEdit;
    ResultsMemo: TMemo;
    DoItButton: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Thread0Label: TLabel;
    Thread1Label: TLabel;
    Thread2Label: TLabel;
    Thread3Label: TLabel;
    Thread4Label: TLabel;
    Thread5Label: TLabel;
    ProgressListBox: TListBox;
    Label14: TLabel;
    ProxyEdit: TEdit;
    Label15: TLabel;
    procedure DoItButtonClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    FInitialized : Boolean;
    FIniFileName : String;
    procedure CreateThread(Sender: TObject);
    procedure SetThreadState(Which : Integer; State: TThreadState);
  public
    procedure ProcessResults(ThreadNumber: Integer; Success : Boolean);
  end;

const
    SectionData   = 'Data';
    KeyURL        = 'URL';
    KeyProxy      = 'Proxy';
    SectionWindow = 'Window';
    KeyTop        = 'Top';
    KeyLeft       = 'Left';
    KeyWidth      = 'Width';
    KeyHeight     = 'Height';

var
    HttpThreadForm: THttpThreadForm;

implementation

{$R *.DFM}

uses
    HttpThr2;             // The thread class is defined there
const
    MaxThreads    = 6;    // If you change this, change labels on the form
var
    // The array with all our threads components
    ThreadsObjects : array [0..MaxThreads - 1] of THTTPThread;
    // The array with all thread states
    ThreadsState   : array [0..MaxThreads - 1] of TThreadState;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.FormCreate(Sender: TObject);
var
    i: Integer;
begin
    FIniFileName := LowerCase(ExtractFileName(Application.ExeName));
    FIniFileName := Copy(FIniFileName, 1, Length(FIniFileName) - 3) + 'ini';
    for i := Low(ThreadsObjects) to High(ThreadsObjects) do
        SetThreadState(i, tsInexistant);  //Not created.
    ResultsMemo.Clear;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.FormShow(Sender: TObject);
var
    IniFile : TIniFile;
begin
    if not FInitialized then begin
        FInitialized   := TRUE;
        IniFile        := TIniFile.Create(FIniFileName);
        URLEdit.Text   := IniFile.ReadString(SectionData, KeyURL,
                                             'http://www.rtfm.be/fpiette');
        ProxyEdit.Text := IniFile.ReadString(SectionData, KeyProxy, '');
        Top            := IniFile.ReadInteger(SectionWindow, KeyTop,    Top);
        Left           := IniFile.ReadInteger(SectionWindow, KeyLeft,   Left);
        Width          := IniFile.ReadInteger(SectionWindow, KeyWidth,  Width);
        Height         := IniFile.ReadInteger(SectionWindow, KeyHeight, Height);

        IniFile.Free;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
var
    IniFile : TIniFile;
begin
    IniFile := TIniFile.Create(FIniFileName);
    IniFile.WriteString(SectionData, KeyURL,       URLEdit.Text);
    IniFile.WriteString(SectionData, KeyProxy,     proxyEdit.Text);
    IniFile.WriteInteger(SectionWindow, KeyTop,    Top);
    IniFile.WriteInteger(SectionWindow, KeyLeft,   Left);
    IniFile.WriteInteger(SectionWindow, KeyWidth,  Width);
    IniFile.WriteInteger(SectionWindow, KeyHeight, Height);
    IniFile.Free;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.DoItButtonClick(Sender: TObject);
var
    i: Integer;
begin
    for i := Low(ThreadsObjects) to High(ThreadsObjects) do begin
        if ThreadsState[i] = tsInexistant then  //Thread has not been created yet
            CreateThread(Self);

        if ThreadsState[i] = tsReady then begin  //Thread is ready for use
            with ThreadsObjects[i] do begin
                FURL     := UrlEdit.Text;
                FProxy   := ProxyEdit.Text;
                SetThreadState(i, tsInUse);   // In use
                Resume;  //get the page
                Exit;    //For now, only start one thread for each click of DoIt
            end;
        end;
    end;
    MessageBeep(MB_OK);
    ShowMessage('No more threads available');
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.CreateThread(Sender: TObject);
var
    i: Integer;
begin
    for i := Low(ThreadsObjects) to High(ThreadsObjects) do begin
        if ThreadsObjects[i] = nil then begin
            ThreadsObjects[i] := THTTPThread.Create(True);
            ThreadsObjects[i].Setup(i);   //Create the HTTP object
            SetThreadState(i, tsReady);
            Exit;  //Found and activated an unused thread
        end;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.SetThreadState(Which : Integer; State: TThreadState);
begin
    ThreadsState[Which] := State;
    case which of
        0: Thread0Label.Caption := IntToStr(Ord(State));
        1: Thread1Label.Caption := IntToStr(Ord(State));
        2: Thread2Label.Caption := IntToStr(Ord(State));
        3: Thread3Label.Caption := IntToStr(Ord(State));
        4: Thread4Label.Caption := IntToStr(Ord(State));
        5: Thread5Label.Caption := IntToStr(Ord(State));
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure LoadMemoFromMemoryStream(Memo : TMemo; Stream : TMemoryStream);
var
    p, q, r : PChar;
begin
    p := Stream.Memory;
    q := p + Stream.Size - 1;
    r := p;
    while (p <> nil) and (p < q) do begin
        while (p < q) and (p^<> #13) do
            Inc(p);
        Memo.Lines.Add(Copy(StrPas(r), 1, p - r));
        if (p[0] = #13) and (p[1] = #10) then
           Inc(p, 2)
        else
           Inc(p);
        r := p;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
// To be called by each thread as it completes (using Synchronize !)
procedure THttpThreadForm.ProcessResults
   (ThreadNumber: Integer; Success : Boolean);
var
    Stream : TMemoryStream;
begin
    ThreadsObjects[ThreadNumber].Suspend;
    if Success then begin
        ResultsMemo.Lines.Add('* * * * * * THREAD ' +
                        IntToStr(ThreadNumber) + ' * * * * * *');
        Stream := ThreadsObjects[ThreadNumber].FHttpCli.RcvdStream
                  as TMemoryStream;
        LoadMemoFromMemoryStream(ResultsMemo, Stream);
        ResultsMemo.Lines.Add('');
    end
    else begin
        // There was an error getting data.
        ResultsMemo.Lines.Add('Nothing returned by thread: ' +
                              IntToStr(ThreadNumber));
    end;
    ResultsMemo.Lines.Add('* * * * * * * * * * * * * * * * * * * *');
    SetThreadState(ThreadNumber, tsReady);
    //Waiting for something to do (get next url here)
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美久久免费观看| 首页综合国产亚洲丝袜| 91久久精品一区二区二区| 亚洲成人一区二区在线观看| 精品福利一区二区三区| 色综合天天综合色综合av| 九九在线精品视频| 亚洲综合成人在线| 91在线看国产| 国产一区二区三区久久久| 亚洲国产欧美另类丝袜| 国产精品免费视频观看| 日韩欧美国产系列| 欧美日韩高清在线| 在线观看日韩毛片| 日本一区二区三级电影在线观看| 麻豆成人在线观看| 亚洲第一成年网| 亚洲欧洲成人av每日更新| 久久久久高清精品| 日韩精品一区二| 91精品国产一区二区三区香蕉| 一本一道久久a久久精品 | 国产精品福利一区二区三区| 日韩亚洲欧美在线| 欧美日韩在线播| 在线视频一区二区免费| 91亚洲资源网| 欧美日韩一区成人| 久久伊99综合婷婷久久伊| 777奇米四色成人影色区| 欧美亚洲一区三区| 在线看不卡av| 欧美性受xxxx黑人xyx性爽| 91啪亚洲精品| 91丝袜高跟美女视频| www.欧美亚洲| 日韩欧美高清一区| 色婷婷综合激情| 在线免费观看视频一区| 91成人免费网站| 欧美日韩在线直播| 欧美人妖巨大在线| 91精品国产乱码久久蜜臀| 日韩一区二区中文字幕| 日韩欧美在线网站| 精品国产精品网麻豆系列| 精品国产一二三| 国产欧美日韩在线观看| 自拍av一区二区三区| 亚洲另类在线视频| 亚洲第一在线综合网站| 日韩中文字幕不卡| 久久www免费人成看片高清| 欧美极品少妇xxxxⅹ高跟鞋| 中文一区在线播放| 亚洲欧美另类小说视频| 亚洲第一成年网| 捆绑调教美女网站视频一区| 国产精品亚洲一区二区三区妖精| 成人午夜在线视频| 亚洲成人资源网| 欧美精品一区二区三区蜜桃| 国产婷婷色一区二区三区四区| 日本一二三不卡| 亚洲亚洲精品在线观看| 毛片不卡一区二区| 福利一区福利二区| 日本韩国欧美在线| 欧美一区二区成人6969| 久久精品一区二区| 一区二区三区视频在线看| 日本在线不卡一区| 国产福利电影一区二区三区| 色综合久久综合| 日韩一区二区免费在线电影| 久久久国产午夜精品| 亚洲男同性恋视频| 欧美激情自拍偷拍| 亚洲高清免费视频| 成人理论电影网| 精品国产凹凸成av人网站| 亚洲欧美日韩系列| 欧美综合视频在线观看| 日韩一区二区影院| 精品国产乱码91久久久久久网站| 国产精品少妇自拍| 日韩国产欧美在线观看| 国产夫妻精品视频| 欧美日韩高清一区二区不卡| 久久精品网站免费观看| 亚洲一区二区av在线| 极品美女销魂一区二区三区免费| 91色porny蝌蚪| 中文字幕一区二区不卡| 日韩精品在线网站| 亚洲综合成人网| 成人精品高清在线| 日韩一区二区精品葵司在线| 综合激情成人伊人| 国产一区二区导航在线播放| 久久国产视频网| 在线观看免费一区| 国产精品久久久久aaaa| 久久精品国产一区二区三| 在线观看成人免费视频| 中文字幕欧美国产| 精品一区二区免费| 欧美人xxxx| 亚洲精品第1页| 在线免费不卡电影| 国产精品视频一二三| 精品一区二区在线观看| 91精品国产综合久久福利| 亚洲自拍偷拍欧美| 色综合一区二区三区| 中文字幕国产精品一区二区| 国产自产v一区二区三区c| 欧美人与禽zozo性伦| 亚洲愉拍自拍另类高清精品| 成人av在线资源| 国产午夜精品一区二区三区嫩草| 蜜臂av日日欢夜夜爽一区| 欧美日韩1区2区| 亚洲国产一二三| 欧美最猛性xxxxx直播| 亚洲裸体xxx| 99麻豆久久久国产精品免费| 国产精品素人一区二区| 亚洲精品综合在线| av一二三不卡影片| 国产麻豆精品95视频| 国产毛片精品视频| 久久伊人蜜桃av一区二区| 国内精品国产成人国产三级粉色| 678五月天丁香亚洲综合网| 日一区二区三区| 琪琪久久久久日韩精品| 国产一级精品在线| 久久麻豆一区二区| 国产成人亚洲综合a∨婷婷图片| 精品国产第一区二区三区观看体验| 久久99久久99精品免视看婷婷| 精品国产123| 粉嫩av一区二区三区在线播放| 国产欧美精品在线观看| 国产iv一区二区三区| 国产精品日韩成人| 91在线观看视频| 奇米精品一区二区三区四区| 国产精品一品视频| 国产一区二区三区精品欧美日韩一区二区三区 | 精品久久国产老人久久综合| 午夜精品久久久久影视| 欧美一区二区三区四区视频 | 国产一区二区福利视频| 中文av一区二区| 欧美性欧美巨大黑白大战| 国产午夜精品一区二区| 成人午夜看片网址| 亚洲黄网站在线观看| 欧美高清视频不卡网| 欧美日韩在线播放一区| 欧美v日韩v国产v| 高清成人在线观看| 亚洲一区在线观看免费观看电影高清 | 午夜电影久久久| 日韩精品一区二区三区在线播放 | 日本大胆欧美人术艺术动态| 日韩三级视频在线看| 国产精品久久久久久亚洲伦| 99精品热视频| 亚洲va中文字幕| 久久久精品tv| 欧美性videosxxxxx| 韩国视频一区二区| 亚洲色图丝袜美腿| 91精品国产一区二区人妖| 成人午夜免费电影| 午夜精品久久久久久久99水蜜桃 | 91久久精品一区二区二区| 日韩**一区毛片| 国产人妖乱国产精品人妖| 欧美视频中文字幕| 国产精品一区二区久久不卡| 一区二区三区日韩欧美精品| 精品国产免费一区二区三区四区| 成人h动漫精品一区二区| 天使萌一区二区三区免费观看| 国产日韩av一区二区| 欧美午夜在线观看| 丁香五精品蜜臀久久久久99网站| 亚洲国产一区二区在线播放| 国产日韩三级在线| 91精品国产综合久久精品麻豆 | 一区二区三区四区亚洲| 国v精品久久久网| 亚洲 欧美综合在线网络| 日本一区二区免费在线观看视频 | 亚洲欧美日韩中文字幕一区二区三区 |