public class SysOption
{
[DllImport("kernel32.dll", SetLastError = true)]
public static extern int SetLocalTime(ref SystemTime lpSystemTime);
public static void UPDateLocalTime()
{
PresenterInfoTech_BaseData pm = new PresenterInfoTech_BaseData();
DateTime serverTime=pm.GetServerDateTime();
SystemTime systime = new SystemTime();
systime.wYear = (short)serverTime.Year;
systime.wMonth = (short)serverTime.Month;
systime.wDay = (short)serverTime.Day;
systime.wHour = (short)serverTime.Hour;
systime.wMinute = (short)serverTime.Minute;
systime.wSecond = (short)serverTime.Second;
SetLocalTime(ref systime);
}
}
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;
}