示例#1
0
 static public void Exitkiosk()
 {
     if (_useOldWay)
     {
         string s = string.Empty;
         if (objTaskMgr != null)
         {
             objTaskMgr.Stop();
             objTaskMgr = null;
         }
         try
         {
             int n1 = WinUtil.fnExitKiosk();
             if (n1 != 0)
             {
                 s = string.Format(System.Globalization.CultureInfo.InvariantCulture, "Error exiting kiosk mode.\r\n{0}", WinUtil.GetWinAPIErrorMessage(n1));
             }
         }
         catch (Exception err)
         {
             s = string.Format("{0}\r\n{1}\r\n{2}", err.GetType().Name, err.Message, err.StackTrace);
         }
         if (!string.IsNullOrEmpty(s))
         {
             MessageBox.Show(null, s, "Exit kiosk", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
示例#2
0
 static public void Enterkiosk()
 {
     if (_useOldWay)
     {
         if (objTaskMgr == null)
         {
             objTaskMgr = new TaskMgrMonitor();
         }
         objTaskMgr.Start();
         string s = string.Empty;
         try
         {
             int n1 = WinUtil.fnSetupKiosk();
             if (n1 != 0)
             {
                 s = string.Format(System.Globalization.CultureInfo.InvariantCulture, "Error setup kiosk mode.\r\n{0}", WinUtil.GetWinAPIErrorMessage(n1));
             }
         }
         catch (Exception err)
         {
             s = err.Message;
         }
         if (!string.IsNullOrEmpty(s))
         {
             MessageBox.Show(null, s, "Enter kiosk", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }