哪位高手做过网络校验时间的软件,最好有源代码
或者提供详细方法也可
谢谢
比较急!!!
另外可以再给分

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      NMDayTime1.ReportLevel := Status_Basic;
      NMDayTime1.TimeOut := 5000;
      NMDayTime1.Host := 'www.netmastersllc.com';
      Label1.Caption := NMDayTime1.DayTimeStr;
    end;你用 NMDayTime1.DayTimeStr;设置本地时钟就是了.
      

  2.   

    我用NMTime 从局域网的另一个机器取得时间,那个机器上明明是14:37:20,
    显示的怎么是06:37:20
    ????
      

  3.   

    提纲一些代码你看看:
    procedure TFrm_Main.N17Click(Sender: TObject);//时间同步
    var
      time:TDateTime;
      tst:TSystemTime;
      zone:TTimeZoneInformation;
      vDateBias:Variant;
    begin
      with DM_Set do
      begin
        Qr_Time.Active:=true;
        time:=Qr_Time.Fields[0].AsDateTime;
        Qr_Time.Active:=false;
      end;
      GetTimeZoneInformation(zone);
      vDateBias:=zone.Bias/1440;
      //showmessage(vdatebias);
      time:=time+vDateBias;
     // ShowMessage(DateTimeToStr(time));
      with tst do
      begin
        wyear:=StrToInt(FormatDateTime('yyyy',time));
        wMonth:=StrToInt(FormatDateTime('mm',time));
        wDay:=StrToInt(FormatDateTime('dd',time));
        wHour:=StrToInt(FormatDateTime('hh',time));
        wMinute:=StrToInt(FormatDateTime('nn',time));
        wSecond:=StrToInt(FormatDateTime('ss',time));
        wMilliseconds:=StrToInt(FormatDateTime('z',time));
      end;
      try
        setSystemTime(tst);
        showmessage('恭喜您,时间同步成功,系统时间已更改!');
      except
        showmessage('时间同步未成功!请检查网络');
        exit;
      end;
    end;
    有问题请发信息到我的E-mail:[email protected]
      

  4.   

    呵呵,这个不难的.使用ICS组件的代码
    网上下载SNTP Client程序,有代码的
    参看RFC2030就可以的CSDN根本无法回复程序代码的,COde太长了
    呵呵,自己在Google找了
      

  5.   

    用INDY组件中TIdDayTimeUDP与TIdDayTimeUDPServer最好。很简单的几句代码就能搞定。TIdDayTimeUDP的DayTimeStr返回时间。有帮助的,虽然是英文,但是相信你能看懂。我是DELPHI7的哟。