WinCE 同步服务器时间至设备
来源:互联网 发布:js.qexvmc.1转跳网址 编辑:程序博客网 时间:2024/05/18 20:32
[DllImport("coredll.dll", SetLastError = true)] public static extern int SetLocalTime(ref SystemTime lpSystemTime); //struct for date/time apis public struct SystemTime { public short wYear; public short wMonth; public short wDayOfWeek; public short wDay; public short wHour; public short wMinute; public short wSecond; public short wMilliseconds; } void settime(System.DateTime remoteTime) { try { SystemTime newTime = new SystemTime(); newTime.wYear = (short)remoteTime.Year; newTime.wMonth = (short)remoteTime.Month; newTime.wDay = (short)remoteTime.Day; newTime.wHour = (short)remoteTime.Hour; newTime.wMinute = (short)remoteTime.Minute; newTime.wSecond = (short)remoteTime.Second; newTime.wMilliseconds = (short)remoteTime.Millisecond; newTime.wDayOfWeek = (short)remoteTime.DayOfWeek; // 设置本地时间 SetLocalTime(ref newTime); } catch { MessageBox.Show("获取服务器时间设置本地时间失败!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); } }
//设置时间
DateTime dt = Convert.ToDateTime(time);settime(dt);
- WinCE 同步服务器时间至设备
- 使用NTP服务器同步Android设备时间
- 使用NTP服务器同步Android设备时间
- Wince 同步更新任务栏时间
- SQL服务器时间同步
- 时间同步服务器
- 配置同步时间服务器
- 服务器/客户端时间同步
- 服务器时间同步
- window 服务器时间同步
- 与时间服务器同步
- GPS时间同步服务器
- 服务器时间同步 centos
- 服务器时间同步
- Linux服务器时间同步
- 时间同步服务器
- 服务器时间同步
- Linux服务器时间同步
- 比较简单的Generic Makefile for C/C++ Program
- 产品经理如何将敏捷落地
- 项目开发经验总结
- Android ComponentName的使用
- REST API测试 —— “趣测API”在线测试工具介绍
- WinCE 同步服务器时间至设备
- dir_webdav_unicode_bypass模块实例
- java内嵌浏览器插件
- 做技术的你是如何平衡工作与生活的?
- 让测试/开发/生产环境相分离
- 在Android Studio 中怎么使用Git和GitHub
- 智能家居是真蓝海还是伪需求?
- 积分公式
- Fragment总结(一)