Der er noget kode her:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfdumpbinpinvoke.aspJef synes ikke at det virke.
Men det gør den her variant:
using System;
using System.Runtime.InteropServices;
public struct SYSTEMTIME
{
public UInt16 Year ;
public UInt16 Month ;
public UInt16 DayOfWeek ;
public UInt16 Day ;
public UInt16 Hour ;
public UInt16 Minute ;
public UInt16 Second ;
public UInt16 MilliSecond ;
}
class MainClass
{
[DllImport("kernel32.dll")]
private static extern bool SetSystemTime(ref SYSTEMTIME st);
public static void Main(string[] args)
{
SYSTEMTIME st = new SYSTEMTIME();
st.Year = 2003;
st.Month = 9;
st.Day = 29;
st.Hour = 21;
st.Minute = 0;
st.Second = 0;
SetSystemTime(ref st);
}
}