예제 #1
0
        // Private functions
        private void InitRegistries()
        {
            RegistryKey RKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            string[] values=RKey.GetValueNames();
            foreach(string r in values){
                StartupItem st = new StartupItem();
                st.name = r;
                st.path = RKey.GetValue(r).ToString();
                st.rights = "CurrentUser";
                st.type = StartupType.Registry;
                Items.Add(st);
            }
            RKey.Close();
            values = null;

            RKey = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            values = RKey.GetValueNames();
            foreach (string r in values)
            {
                StartupItem st = new StartupItem();
                st.name = r;
                st.path = RKey.GetValue(r).ToString();
                st.rights = "LocalMachine";
                st.type = StartupType.Registry;
                Items.Add(st);
            }
            RKey.Close();
        }
예제 #2
0
파일: Startup.cs 프로젝트: PSanni/Sweeper
 private bool DisableItem(String name, String Path)
 {
     StartupProgramChanger stChanger;
     StartupItem stItem = new StartupItem();
     foreach (StartupItem item in StartupItemList)
     {
         if (item.name == name && item.path == Path)
         {
             stItem = item;
         }
     }
     stChanger = new StartupProgramChanger(stItem);
     if (stChanger.Disable())
     {
         stItem.Status = false;             //Disabling the item...
         ManiPulateListView();
         return true;
     }
     return false;
 }
예제 #3
0
파일: Startup.cs 프로젝트: PSanni/Sweeper
 private bool MatchToList(StartupItem SItem)
 {
     foreach (StartupItem Item in StartupItemList)
     {
         if (Item.name == SItem.name && Item.path == SItem.path)
         {
             return true;
         }
     }
     return false;
 }
예제 #4
0
 public StartupProgramChanger(StartupItem st)
 {
     this.st = st;
 }