在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
[StructLayout(LayoutKind.Sequential)] public struct SYSTEMTIME { public ushort wYear; public ushort wMonth; public ushort wDayOfWeek; public ushort wDay; public ushort wHour; public ushort wMinute; public ushort wSecond; public ushort wMilliseconds; } [DllImport("coredll.dll")] private static extern bool SetLocalTime(ref SYSTEMTIME lpSystemTime); [DllImport("coredll.dll")] private static extern bool GetLocalTime(ref SYSTEMTIME lpSystemTime); SYSTEMTIME lpTime = new SYSTEMTIME (); lpTime.wYear = Convert.ToUInt16(N.Text); lpTime.wMonth = Convert.ToUInt16(Y.Text); lpTime.wDay = Convert.ToUInt16(R.Text); lpTime.wHour = Convert.ToUInt16(S.Text); lpTime.wMinute = Convert.ToUInt16(F.Text); lpTime.wSecond = Convert.ToUInt16(M.Text); SetLocalTime(ref lpTime);
|
请发表评论