Esempio n. 1
0
        public static string GetTime()
        {
            SYSTEMTIME sYSTETIME = default(SYSTEMTIME);

            SystemTimer.GetLocalTime(ref sYSTETIME);
            return(sYSTETIME.wHour.ToString() + ":" + sYSTETIME.wMinute.ToString());
        }
Esempio n. 2
0
        public static string   SetTime(ushort hour, ushort minute)
        {
            string result;

            try
            {
                SYSTEMTIME sYSTEMTIME = default(SYSTEMTIME);
                SystemTimer.GetLocalTime(ref sYSTEMTIME);
                sYSTEMTIME.wHour   = hour;
                sYSTEMTIME.wMinute = minute;
                SystemTimer.SetLocalTime(ref sYSTEMTIME);
                result = "sucess";
            }
            catch
            {
                result = "failed";
            }
            return(result);
        }