|
Last change
on this file was 2, checked in by chronos, 13 years ago |
- Přidáno: Základní kostra projektu.
- Přidáno: Knihovna synapse.
|
|
File size:
773 bytes
|
| Line | |
|---|
| 1 | unit Unit1;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|---|
| 7 | SNTPsend, StdCtrls;
|
|---|
| 8 |
|
|---|
| 9 | type
|
|---|
| 10 | TForm1 = class(TForm)
|
|---|
| 11 | Edit1: TEdit;
|
|---|
| 12 | Label1: TLabel;
|
|---|
| 13 | Button1: TButton;
|
|---|
| 14 | Label2: TLabel;
|
|---|
| 15 | procedure Button1Click(Sender: TObject);
|
|---|
| 16 | private
|
|---|
| 17 | { Private declarations }
|
|---|
| 18 | public
|
|---|
| 19 | { Public declarations }
|
|---|
| 20 | end;
|
|---|
| 21 |
|
|---|
| 22 | var
|
|---|
| 23 | Form1: TForm1;
|
|---|
| 24 |
|
|---|
| 25 | implementation
|
|---|
| 26 |
|
|---|
| 27 | {$R *.DFM}
|
|---|
| 28 |
|
|---|
| 29 | procedure TForm1.Button1Click(Sender: TObject);
|
|---|
| 30 | var
|
|---|
| 31 | sntp:TSntpSend;
|
|---|
| 32 | begin
|
|---|
| 33 | sntp:=TSntpSend.Create;
|
|---|
| 34 | try
|
|---|
| 35 | sntp.TargetHost:=Edit1.Text;
|
|---|
| 36 | if sntp.GetSNTP
|
|---|
| 37 | then label2.Caption:=Datetimetostr(sntp.NTPTime)+' UTC'
|
|---|
| 38 | else label2.Caption:='Not contacted!';
|
|---|
| 39 | finally
|
|---|
| 40 | sntp.Free;
|
|---|
| 41 | end;
|
|---|
| 42 | end;
|
|---|
| 43 |
|
|---|
| 44 | end.
|
|---|
| 45 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.