示例#1
0
        private static void Main()
        {
            AttachConsole(-1);


            int count = 0;

            while (true)
            {
                // Run every minute
                string lastestCurrentImage = FindImage.FindCurrentImage();
                if (_currSpotlightPath != lastestCurrentImage)
                {
                    _currSpotlightPath = lastestCurrentImage;
                    UpdateDesktop();
                }

                // Run twice a day
                if ((count % 60 * 12) == 0 && File.Exists("update.exe"))
                {
                    System.Diagnostics.Process.Start("update.exe");
                    count = 0;
                }

                if (RunOnce)
                {
                    break;
                }

                // Check every minute
                Thread.Sleep(60 * 1000);
                count++;
            }
        }
示例#2
0
        private static void Main()
        {
            AttachConsole(-1);

            string lastestCurrentImage = FindImage.FindCurrentImage();

            if (_currSpotlightPath != lastestCurrentImage)
            {
                _currSpotlightPath = lastestCurrentImage;
                UpdateDesktop();
            }

            /*
             * int count = 0;
             * while (true)
             * {
             *  // Run every minute
             *  string lastestCurrentImage = FindImage.FindCurrentImage();
             *  if (_currSpotlightPath != lastestCurrentImage)
             *  {
             *      _currSpotlightPath = lastestCurrentImage;
             *      UpdateDesktop();
             *  }
             *
             *  // Run twice a day
             *  if ((count % 60 * 12) == 0 && File.Exists("update.exe"))
             *  {
             *      System.Diagnostics.Process.Start("update.exe");
             *      count = 0;
             *  }
             *
             *  if (RunOnce)
             *  {
             *      break;
             *  }
             *
             *  // Check every minute
             *  Thread.Sleep(60 * 1000);
             *  count++;
             * }
             */
        }