-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (27 loc) · 790 Bytes
/
Program.cs
File metadata and controls
28 lines (27 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
namespace ro.bocan.sntpclient
{
class Program
{
const string Host = "0.pool.ntp.org";
const int TimeOut = 5000;
static void Main()
{
Console.WriteLine("SNTP Client v1.0");
Console.WriteLine("(C)2001-2019 Valer BOCAN, PhD <valer@bocan.ro>");
Console.WriteLine();
Console.WriteLine($"Connecting to {Host}...");
Console.WriteLine();
try
{
var client = new SNTPClient();
client.Connect(Host, TimeOut);
Console.WriteLine(client.ToString());
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}