/// <summary> /// 获取配置信息。如果不存在,则返回默认的设置 /// </summary> /// <returns></returns> public static SNTPSettings GetConfigOrDefault() { SNTPSettings settings = SNTPSettings.GetConfig(); if (settings == null) { settings = new SNTPSettings(); } return(settings); }
/// <summary> /// 从配置信息中获取远程时间服务器的设置 /// </summary> /// <returns></returns> public static RemoteSNTPServer GetSNTPServer() { SNTPSettings settings = SNTPSettings.GetConfig(); RemoteSNTPServer server = RemoteSNTPServer.Default; if (settings != null) { server = new RemoteSNTPServer(settings.ServerName, settings.Port); } return(server); }