Пример #1
0
        public void OnTimer(object sender, System.Timers.ElapsedEventArgs args)
        {
            string username = getLoginUserName();

            if (!_currentUserName.Equals(username))
            {
                eventLog1.WriteEntry("Login user changed, new user: "******"Current Login User: "******"KidsGuard"];
                eventLog1.WriteEntry("KidsGuard is not running, start it: " + applicationName, EventLogEntryType.Information);
                ApplicationLoader.PROCESS_INFORMATION procInfo;
                ApplicationLoader.StartProcessAndBypassUAC(applicationName, username, eventLog1, out procInfo);
            }
        }
Пример #2
0
        bool isKidsGuardRunning(string loginUser)
        {
            Process[] processes = Process.GetProcessesByName("KidsComputerGuard");
            foreach (Process p in processes)
            {
                string owner = ApplicationLoader.GetProcessOwner(p.Id);
                if (owner.Equals(loginUser, StringComparison.OrdinalIgnoreCase))
                {
                    return(true);
                }
            }

            return(false);
        }