Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphiÏ̳߳ء¾×ª¡¿


[code=Delphi(Pascal)]
unit uThreadPool;
{  aPool.AddRequest(TMyRequest.Create(RequestParam1, RequestParam2, ...)); }
interface
uses
  Windows,
  Classes;
// ÊÇ·ñ¼Ç¼ÈÕÖ¾
// {$DEFINE NOLOGS}
type
  TCriticalSection = class(TObject)
  protected
    FSection: TRTLCriticalSection;
  public
    constructor Create;
    destructor Destroy; override;
    // ½øÈëÁÙ½çÇø
    procedure Enter;
    // À뿪ÁÙ½çÇø
    procedure Leave;
    // ³¢ÊÔ½øÈë
    function TryEnter: Boolean;
  end;
type
  // ´¢´æÇëÇóÊý¾ÝµÄ»ù±¾Àà
  TWorkItem = class(TObject)
  public
    // ÊÇ·ñÓÐÖظ´ÈÎÎñ
    function IsTheSame(DataObj: TWorkItem): Boolean; virtual;
    // Èç¹û NOLOGS ±»¶¨Ò壬Ôò½ûÓá£
    function TextForLog: string; virtual;
  end;
type
  TThreadsPool = class;
  //Ïß³Ì״̬
  TThreadState = (tcsInitializing, tcsWaiting, tcsGetting, tcsProcessing,
    tcsProcessed, tcsTerminating, tcsCheckingDown);
  // ¹¤×÷Ï߳̽öÓÃÓÚÏ̳߳ØÄÚ£¬ ²»ÒªÖ±½Ó´´½¨²¢µ÷ÓÃËü¡£
  TProcessorThread = class(TThread)
  *******
    // ´´½¨Ïß³ÌʱÁÙʱµÄEvent¶ÔÏó, ×èÈûÏß³ÌÖ±µ½³õʼ»¯Íê³É
    hInitFinished: THandle;
    // ³õʼ»¯³ö´íÐÅÏ¢
    sInitError: string;
    // ¼Ç¼ÈÕÖ¾
    procedure WriteLog(const Str: string; Level: Integer = 0);
  protected
    // Ïß³ÌÁÙ½çÇøͬ²½¶ÔÏñ
    csProcessingDataObject: TCriticalSection;
    // ƽ¾ù´¦Àíʱ¼ä
    FAverageProcessing: Integer;
    // µÈ´ýÇëÇóµÄƽ¾ùʱ¼ä
    FAverageWaitingTime: Integer;
    // ±¾Ïß³ÌʵÀýµÄÔËÐÐ״̬
    FCurState: TThreadState;
    // ±¾Ïß³ÌʵÀýËù¸½ÊôµÄÏ̳߳Ø
    FPool: TThreadsPool;
    // µ±Ç°´¦ÀíµÄÊý¾Ý¶ÔÏñ¡£
  &


Ïà¹ØÎĵµ£º

Delphi ÖÐMd5»ñÈ¡£¨Indy 9£©







ÔÚDelphi×Ô´øµÄIndy¿Ø¼þÖÐÆäʵÊÇÌṩÁËMD2,MD4,MD5¶ÔÏóµÄ£¬ÎÒÃÇ¿ÉÒÔÖ±½ÓʹÓÃËüÃÇÀ´Íê³ÉMD5µÄÇ©ÃûËã·¨¡£¶ø²»ÐèÒªÔÙÈ¥ÕÒÆäËüµÄ
DLL»òÊÇPasÁË¡£
ÔÚUsesµ¥ÔªÖÐÒýÓà IdHashMessageDigest,IdGlobal, IdHash µ¥Ôª£¬ÔÙдÈçÏ´úÂë¼´¿ÉÒÔ´ïµ½MD5µÄʵÏÖ¡£
ʾÀý´úÂë
procedure TForm1.Button1Click(Sen ......

DelphiʼþµÄ¹ã²¥


    Ã÷Ìì¾ÍÊÇÎåÒ»½ÚÁË£¬ÐÁ¿àÁ˺ü¸¸öÔ£¬½è´Ë»ú»áÓ¦¸Ã¾¡Çé·ÅËÉÒ»·¬¡£¿ÉÊÇÏëµ½BlogºÃ¾ÃûÓÐдÎÄÕ£¬ËƺõȱЩʲôËƵġ£Õ⼸¸öÔÂÀ´ÔÚÏîÄ¿ÖÐÓÖÔö³¤ÁËÐí¶à¾­Ñ飬ѧµ½Ðí¶àʵ¼ÊÓ¦ÓõÄ֪ʶ¡£²»Èç°ÑһЩ±È½ÏÓÐÓõļǼÏÂÀ´£¬¹©ÅóÓÑÃDzο¼¿ÉºÃ¡£
ÎÒÏëµ½DelphiµÄʼþ£¬ÄÇ¿ÉÕæÊǸö·½±ãµÄ¶«Î÷£¬³õѧÕßÔÚ´°ÌåÉÏÀ­¼¸¸ö¿ ......

C# Delphi´¦Àí·ÖÎöQQЭÒé


C# Delphi´¦Àí·ÖÎöQQЭÒé
 
 
¡¡´ó¼Ò˵µ½QQЭÒ鶼¾õµÃºÜÉñÃØ£¬ÊÇÒòΪQQ²»ÏñMSN»òÕßICQЭÒ鶼ÒѾ­¹Ù·½¹«²¼ÁË£¬¶øQQµÄûÓй«²¼¡£Ñо¿ËüµÄÈËÒ²²»ÊÇÌرðµÄ¶à£¬ËäÈ»ÒѾ­ÓÐÁË»ùÓÚ QQЭÒéËùд³ÉµÄµÚÈý·½Èí¼þ foicq, qq plugins for gaim, LumaQQ£¬µ«ÊÇÓÉÓÚËûÃÇÊÇ»ùÓÚ¶þ½øÖÆStreamµÄЭÒé¹ýÓÚ¸´ÔÓ£¬´ó¼ÒÔĶÁ´úÂëÒ²ÓÐÒ ......

delphiÖÐDateTimePickerͬʱÐÞ¸ÄÈÕÆÚºÍʱ¼äµÄʵÏÖ

µÚÒ»ÖÖ·½·¨£º
µÚÒ»²½£º ÐÞ¸ÄÊôÐÔ
    1¡¢kind -> dtktime Ò²¿ÉÒÔÊÇdtkdate µ«ÊÇÔÚÓÃdtkdateµÄʱºòÐèÒª½«datemodeÊôÐÔÐ޸ijÉdmUpDown
    2¡¢parseinput -> true
µÚ¶þ²½£ºÔÚonUserInputʼþÖÐдһ¾ä´úÂë
DateTimePicker1.DateTime:=DateAndTime;
×¢£ºÒÔÉÏ·½·¨ËäÈ»¿ÉÒԴﵽĿµÄ£¬µ ......

Ò»¸ö·½±ãÓÐÓõÄDelphiÊý¾Ý¿â²Ù×÷Àà(ת)

unit MyADO;
interface
uses
SysUtils, Classes,ADODB,DB,Variants,StdCtrls,Dialogs;
type
TMyADO = class(TComponent)
    private
    Connection: TADOConnection;
    Query: TADOQuery;
    Table: TADOTable;
    FConnectio ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ