可以通过 P/Invoke 来实现,代码如下:[StructLayout(Layout.Sequential)]
struct SYSTEMTIME {
short year;
short month;
short dayOfWeek;
short day;
short hour;
short minute;
short second;
short milliseconds;
}And then call it using this:[DllImport("kernel32.dll")]
static extern bool SetSystemTime(SYSTEMTIME time);