Exemplo n.º 1
0
        /// <summary>
        /// Searches the current system for files contained within a blacklist and attempts to remove them.
        /// </summary>
        /// <param name="container">A collection of files to search the system for.</param>
        internal void CheckSystem(BlacklistContainer container = null)
        {
            // Check the current system for blacklisted files.
            if (!IsDebugging())
            {
                if (container != null)
                {
                    if (IsAdmin())
                    {
                        IsWorking = true;
                        Thread t = new Thread(() => Search(Blacklist.Files));
                        t.Start();

                        // Let the previous thread finish before continuing.
                        while (IsWorking)
                        {
                            Thread.Sleep(100);
                        }
                    }
                }
            }
            else
            {
                throw new Exception("The process is currently being debugged.");
            }

            // Reset our flags.
            IsWorking = false;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a <see cref="LocalSystem"/> object with a collection of blacklisted files to removed from the system.
 /// </summary>
 /// <param name="container"></param>
 public LocalSystem(BlacklistContainer container)
 {
     Blacklist = container;
 }