public static bool SyncLocalTime(DateTime currentTime) { SystemTime sysTime = new SystemTime(); sysTime.wYear = (ushort)currentTime.Year; sysTime.wMonth = (ushort)currentTime.Month; sysTime.wDay = (ushort)currentTime.Day; sysTime.wHour = (ushort)currentTime.Hour; sysTime.wMinute = (ushort)currentTime.Minute; sysTime.wSecond = (ushort)currentTime.Second; try { return(SetLocalTime(ref sysTime));//设置本机时间 } catch (Exception ex) { LogHelper.ErrorLog(ex); return(false); } }
public static void CallPhone(object message) { try { // var phoneEvent=Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<CallPhoneEvent>(); // if (ocxHelper==null) // { // ocxHelper =new ClientOCXHelper(); // //ScsClient.Connect(); //Connect to the server // //string msg = string.Format("callmobile:{0};", message); // //ScsClient.SendMessage(new ScsTextMessage(msg)); // ocxHelper.OnInit += (s, e) => helper_OnInit(s, e, message); // ocxHelper.OnOcxCallOver += ocxHelper_OnCallOver; // ocxHelper.OnOcxCallReceived += ocxHelper_OnCallReceived; // string user = Application.Current.Resources["XhUser"].ToString(); // string password = Application.Current.Resources["Xhpassword"].ToString(); // ocxHelper.Init(user, password); // } // else // { // string phone = message.ToString();//"313808099512"; // if (message.ToString().Contains("-")) // { // phone = message.ToString().Replace("-", ""); // } // else if (message.ToString().Contains("AA")) // { // phone = message.ToString().Replace("AA",""); // } // else // { // phone = "3" + phone; // } // ocxHelper.CallMobile(phone, "1"); // } } catch (Exception ex) { LogHelper.ErrorLog(ex); } }