コード例 #1
0
 static void Main(string[] args)
 {
     try
     {
         MySystemTime sysTime = new MySystemTime();
         LibWrapper.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
 static void Main(string[] args)
 {
     try
     {
         MySystemTime sysTime = new MySystemTime();
         LibWrapper.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);
     }
 }
コード例 #3
0
 public static extern void GetSystemTime([MarshalAs(UnmanagedType.LPStruct)] MySystemTime st);