Пример #1
0
 public static void Main()
 {
     try
     {
         MySystemTime sysTime = new MySystemTime();
         NativeMethods.GetSystemTime(sysTime);
         Console.WriteLine("The System time is {0}/{1}/{2} {3}:{4}:{5}", sysTime.wDay,
                           sysTime.wMonth, sysTime.wYear, sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
     }
     catch (TypeLoadException e)
     {
         Console.WriteLine("TypeLoadException : " + e.Message);
     }
     catch (Exception e)
     {
         Console.WriteLine("Exception : " + e.Message);
     }
 }
Пример #2
0
 internal static extern void GetSystemTime([MarshalAs(UnmanagedType.LPStruct)] MySystemTime st);