[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.wH
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交