我想调用这个网站的时间:
http://bjtime.cn/
这个网站是北京时间的。
我想调用它。例如:当那个网站的时间为2009年3月30号 19:00:00时
我程序里的checkbox1属性为false 那么该如何写?

解决方案 »

  1.   

    这个网站的[现在时间]是取自你本机当前系统时间的。在页面代码里并没有返回任何时间,除非你安装它的ActiveX控件。
      

  2.   

    刚刚搞定一个和你一模一样的问题
    而这个问题是我昨天正好刚研究过的
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, OleCtrls, SHDocVw,mshtml;type
      TForm1 = class(TForm)
        WebBrowser1: TWebBrowser;
        Button1: TButton;
        Edit1: TEdit;
        procedure Button1Click(Sender: TObject);
        procedure WebBrowser1DocumentComplete(Sender: TObject;
          const pDisp: IDispatch; var URL: OleVariant);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
    WebBrowser1.Navigate('http://s.time.org.cn/clock/'); //打开地址
    end;procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
      const pDisp: IDispatch; var URL: OleVariant);
    begin
    edit1.Text:=IHtmlDocument2(WebBrowser1.Document).Body.Outertext;end;end.
    -----------------------
    object Form1: TForm1
      Left = 409
      Top = 176
      Width = 424
      Height = 364
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object WebBrowser1: TWebBrowser
        Left = 32
        Top = 16
        Width = 300
        Height = 150
        TabOrder = 0
        OnDocumentComplete = WebBrowser1DocumentComplete
        ControlData = {
          4C000000021F0000810F00000000000000000000000000000000000000000000
          000000004C000000000000000000000001000000E0D057007335CF11AE690800
          2B2E126208000000000000004C0000000114020000000000C000000000000046
          8000000000000000000000000000000000000000000000000000000000000000
          00000000000000000100000000000000000000000000000000000000}
      end
      object Button1: TButton
        Left = 80
        Top = 184
        Width = 75
        Height = 25
        Caption = 'Button1'
        TabOrder = 1
        OnClick = Button1Click
      end
      object Edit1: TEdit
        Left = 48
        Top = 224
        Width = 169
        Height = 21
        TabOrder = 2
        Text = 'Edit1'
      end
    end
      

  3.   

    你只要对edit1里取到的时间做判断即可