示例#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;
 }