⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demounit.dfm

📁 PIC 单片机 PAS SOURCE CODE SAMPLES
💻 DFM
📖 第 1 页 / 共 5 页
字号:
          
            #9#9'nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse +' +
            '= navigator.mimeTypes[i].type.toLowerCase();'
          
            #9#9'pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS' +
            '("application/x-director","Shockwave Director") + detectNS'
          
            '("application/x-shockwave-flash","Shockwave Flash") + detectNS("' +
            'audio/x-pn-realaudio-plugin","RealPlayer") + detectNS'
          
            '("video/quicktime","QuickTime") + detectNS("application/x-mplaye' +
            'r2","Windows Media Player") + detectNS("application/pdf","Acroba' +
            't Reader");'
          '}'
          ''
          
            'function detectIE(ClassID,name) { result = false; document.write' +
            '('#39'<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = ' +
            'IsObject'
          
            '(CreateObject("'#39' + ClassID + '#39'"))</SCRIPT>\n'#39'); if (result) retu' +
            'rn name+'#39','#39'; else return '#39#39'; }'
          
            'function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassI' +
            'D) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null' +
            ') n = name+","; return n; }'
          ''
          'pluginlist += navigator.javaEnabled() ? "Java," : "";'
          
            'if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,p' +
            'luginlist.length-1);'
          ''
          '//SAMPLE USAGE- detect "Flash"'
          '//if (pluginlist.indexOf("Flash")!=-1)'
          '//document.write("You have flash installed")')
        ScrollBars = ssBoth
        TabOrder = 0
      end
    end
    object tsDFM: TTabSheet
      Caption = 'DFM'
      ImageIndex = 6
      object edDFM: TRichEdit
        Left = 0
        Top = 0
        Width = 735
        Height = 570
        Align = alClient
        Font.Charset = RUSSIAN_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Courier New'
        Font.Style = []
        Lines.Strings = (
          'object frmDemo: TfrmDemo'
          '  Left = 252'
          '  Top = 161'
          '  Width = 751'
          '  Height = 632'
          '  Caption = '#39'Demo'#39
          '  Color = clBtnFace'
          '  Font.Charset = DEFAULT_CHARSET'
          '  Font.Color = clWindowText'
          '  Font.Height = -11'
          '  Font.Name = '#39'MS Sans Serif'#39
          '  Font.Style = []'
          '  OldCreateOrder = False'
          '  Position = poScreenCenter'
          '  OnCreate = FormCreate'
          '  PixelsPerInch = 96'
          '  TextHeight = 13'
          '  object PageControl: TPageControl'
          '    Left = 0'
          '    Top = 0'
          '    Width = 743'
          '    Height = 605'
          '    ActivePage = tsDelphi'
          '    Align = alClient'
          '    TabOrder = 0'
          '    object tsDelphi: TTabSheet'
          '      Caption = '#39'Delphi'#39
          '      object edDelphi: TRichEdit'
          '        Left = 0'
          '        Top = 0'
          '        Width = 735'
          '        Height = 577'
          '        Align = alClient'
          '        Font.Charset = RUSSIAN_CHARSET'
          '        Font.Color = clWindowText'
          '        Font.Height = -13'
          '        Font.Name = '#39'Courier New'#39
          '        Font.Style = []'
          '        Lines.Strings = ('
          
            '          '#39'{****************************************************' +
            '***}'#39
          
            '          '#39'{                                                    ' +
            '   }'#39
          
            '          '#39'{  idCGIRunner component for Internet Direct (Indy)  ' +
            '   }'#39
          
            '          '#39'{                   HTTP Server                      ' +
            '   }'#39
          
            '          '#39'{                                                    ' +
            '   }'#39
          
            '          '#39'{ Author:                                            ' +
            '   }'#39
          
            '          '#39'{ Serhiy Perevoznyk                                  ' +
            '   }'#39
          
            '          '#39'{ serge_perevoznyk@hotmail.com                       ' +
            '   }'#39
          
            '          '#39'{                                                    ' +
            '   }'#39
          
            '          '#39'{     Use, modification and distribution is allowed  ' +
            '   }'#39
          
            '          '#39'{without limitation, warranty, or liability of any ki' +
            'nd.}'#39
          
            '          '#39'{                                                    ' +
            '   }'#39
          
            '          '#39'{****************************************************' +
            '***}'#39
          '          '#39#39
          '          '#39'unit idCGIRunner;'#39
          '          '#39#39
          '          '#39'interface'#39
          '          '#39#39
          '          '#39'uses'#39
          '          '#39'  Windows,'#39
          '          '#39'  SysUtils,'#39
          '          '#39'  Classes,'#39
          '          '#39'  idTCPServer,'#39
          '          '#39'  idHTTPServer;'#39
          '          '#39#39
          '          '#39'type'#39
          
            '          '#39'  {TidCGIRunner component allows to execute CGI scrip' +
            'ts using '#39
          '          '#39'   Indy TidHTTPServer component} '#39
          '          '#39'  TidCGIRunner = class(TComponent)'#39
          '          '#39'   private'#39
          '          '#39'     FServer : TidHTTPServer;'#39
          '          '#39'     FTimeOut : integer;'#39
          '          '#39'     FTimeOutMsg : string;'#39
          '          '#39'     FErrorMsg : string;'#39
          '          '#39'     FServerAdmin : string;'#39
          '          '#39'     FDocumentRoot : string;'#39
          
            '          '#39'     procedure SetServer(const AValue : TIdHTTPServer' +
            ');'#39
          '          '#39'   protected'#39
          
            '          '#39'      //Forwards notification messages to all owned c' +
            'omponents.'#39
          '          '
          
            '            '#39'      procedure Notification(AComponent: TComponent' +
            '; Operation: '#39' +'
          '            '#39'TOperation); override;'#39
          '          '#39'   public'#39
          '          '
          
            '            '#39'     //Allocates memory and constructs a safely ini' +
            'tialized inst'#39' +'
          '            '#39'ance of a component.'#39
          
            '          '#39'     constructor Create(AOwner : TComponent); overrid' +
            'e;'#39
          
            '          '#39'     {Execute CGI executable and return result to Web' +
            'Server'#39
          
            '          '#39'      LocalDoc - the full local path to executable fi' +
            'le'#39
          '          '#39'      e.g. c:\inetpub\wwwroot\cgi-bin\cgi.exe'#39
          '          '
          
            '            '#39'      RequestInfo - TIdHTTPRequestInfo publishes pr' +
            'operties that'#39' +'
          '            '#39' provide '#39
          
            '          '#39'      access to various information for a HTTP reques' +
            't. '#39
          '          '
          
            '            '#39'      The properties include the HTTP session, auth' +
            'entication pa'#39' +'
          '            '#39'rameters, '#39
          '          '
          
            '            '#39'      the remote computer addresses, HTTP headers, ' +
            'cookies, the '#39' +'
          '            '#39'HTTP command '#39
          
            '          '#39'      and version, and the document URL for the reque' +
            'st.'#39
          '          '
          
            '            '#39'      ResponseInfo - IdHTTPResponseInfo publishes p' +
            'roperties tha'#39' +'
          '            '#39't provide '#39
          
            '          '#39'      access to various information for a HTTP respon' +
            'se.'#39
          '          '
          
            '            '#39'      These properties include the HTTP session, th' +
            'e authenticat'#39' +'
          '            '#39'ion realm, '#39
          '          '
          
            '            '#39'      Cookies, Headers, and the response content, l' +
            'ength, and ty'#39' +'
          '            '#39'pe.'#39
          '          '
          
            '            '#39'      Action - PathInfo of TWebActionItem of your C' +
            'GI executable'#39' +'
          '            '#39'}'#39
          '          '#39'     function Execute(LocalDoc : string;'#39
          '          '#39'                      AThread: TIdPeerThread;'#39
          
            '          '#39'                      RequestInfo: TIdHTTPRequestInfo' +
            ';'#39
          
            '          '#39'                      ResponseInfo: TIdHTTPResponseIn' +
            'fo;'#39
          
            '          '#39'                      Action : string = '#39'#39#39'#39') : i' +
            'nteger;'#39
          '          '#39'   published'#39
          '          '#39'     //Indy TidHTTPServer'#39
          '          '
          
            '            '#39'     property Server : TidHTTPServer read FServer w' +
            'rite SetServe'#39' +'
          '            '#39'r;'#39
          
            '          '#39'     //Specifies the time-out interval, in millisecon' +
            'ds'#39
          '          '
          
            '            '#39'     property TimeOut: integer read FTimeOut write ' +
            'FTimeOut defa'#39' +'
          '            '#39'ult 5000;'#39
          '          '#39'     //Time-out error message text'#39
          '          '
          
            '            '#39'     property TimeOutMsg : string read FTimeOutMsg ' +
            'write FTimeOu'#39' +'
          '            '#39'tMsg;'#39
          '          '#39'     //General error message text'#39
          
            '          '#39'     property ErrorMsg : string read FErrorMsg write ' +
            'FErrorMsg;'#39
          '          '
          
            '            '#39'     {Email address of Server Administator (optiona' +
            'l, for compat'#39' +'
          '            '#39'ibility'#39
          '          '#39'      with Apache) }'#39
          '          '
          
            '            '#39'     property ServerAdmin : string read FServerAdmi' +
            'n write FServ'#39' +'
          '            '#39'erAdmin;'#39
          '          '#39'     //Local path to virtual root of your WebServer'#39
          '          '
          
            '            '#39'     property DocumentRoot : string read FDocumentR' +
            'oot write FDo'#39' +'
          '            '#39'cumentRoot;'#39
          '          '#39'   end;'#39
          '          '#39#39
          '          '#39'//register TidCGIRunner component'#39
          '          '#39'procedure Register;'#39
          '          '#39#39
          '          '#39'implementation'#39
          '          '#39#39
          '          '#39'type'#39
          '          '#39'  ThreadParams = record'#39
          '          '#39'    hReadPipe : THandle;'#39
          '          '#39'    s : String;'#39
          '          '#39'  end;'#39
          '          '#39'  PThreadParams = ^ThreadParams;'#39
          '          '#39#39
          
            '          '#39'function ThreadRead(Params : Pointer):Dword; stdcall;' +
            #39
          '          '#39'var'#39
          '          '#39'  Info : PThreadParams;'#39
          '          '#39'  Buffer :  array [0..4095] of Char;'#39
          '          '#39'  nb: DWord;'#39
          '          '#39'  i: Longint;'#39
          '          '#39'begin'#39
          '          '#39'  Result := 0;'#39
          '          '#39'  Info := PThreadParams(Params);'#39
          '          '#39'  while ReadFile( Info^.hReadPipe,'#39
          '          '#39'                  buffer,'#39
          '          '#39'                  SizeOf(buffer),'#39
          '          '#39'                  nb,'#39
          '          '#39'                  nil) do'#39
          '          '#39'     begin'#39
          '          '#39'       if nb = 0 then'#39
          '          '#39'         Break;'#39
          '          '#39'       for i:=0 to nb-1 do'#39
          '          '#39'         Info^.s := Info^.s + buffer[i];'#39
          '          '#39'      end;'#39
          '          '#39#39
          '          '#39'end;'#39
          '          '#39#39
          '          '#39#39
          '          '#39'function GetEnv(const Name: string): string;'#39
          '          '#39'var'#39

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -