public int Synchronize() { SNTPClient client; try { client = new SNTPClient(TimeServer); client.Connect(true); } catch (Exception e) { textBox1.Text = "Error: " + "The time server has not responded.\r\n" + "The operation timed out.\r\n" + "\r\n" + e.Message; return(-1); } textBox1.Text = client.ToString(); return(0); }
public int Synchronize() { SNTPClient client; try { client = new SNTPClient(TimeServer); client.Connect(true); } catch (Exception e) { textBox1.Text = "Error: " + "The time server has not responded.\r\n" + "The operation timed out.\r\n" + "\r\n" + e.Message; return -1; } textBox1.Text = client.ToString(); return 0; }