示例#1
0
        private List <UpdateStuff> HellothereStranger()
        {
            List <UpdateStuff> applist = new List <UpdateStuff>();

            Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.LocalMachine;
            string subKey1 =
                "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";

            Microsoft.Win32.RegistryKey uinstallkey = regKey.OpenSubKey(subKey1);

            string[] subKeyNames = uinstallkey.GetSubKeyNames();



            foreach (string subKeyName in subKeyNames)
            {
                Microsoft.Win32.RegistryKey subKey2 = regKey.OpenSubKey(subKey1 + "\\" + subKeyName);

                if (ValueNameExists(subKey2.GetValueNames(), "DisplayName") &&
                    ValueNameExists(subKey2.GetValueNames(), "DisplayVersion"))
                {
                    string appName    = (string)subKey2.GetValue("DisplayName");
                    string appVersion = (string)subKey2.GetValue("DisplayVersion");
                    Console.WriteLine("Name:{0}, Version{1}", appName, appVersion);
                    UpdateStuff game = new UpdateStuff(appName, appVersion);
                    applist.Add(game);
                }

                subKey2.Close();
            }

            uinstallkey.Close();
            return(applist);
        }
示例#2
0
        private void LoadDataGridData()
        {
            List <UpdateStuff> applist = HellothereStranger();

            DatagridAvan1.ItemsSource = "{Binding UpdateStuff}";
            DataGridTextColumn ColName = new DataGridTextColumn();

            ColName.Header  = "Name";
            ColName.Binding = new Binding("AppName");

            DataGridTextColumn ColName1 = new DataGridTextColumn();

            ColName1.Header  = "Version";
            ColName1.Binding = new Binding("AppVers");

            DatagridAvan1.Columns.Add(ColName);
            DatagridAvan1.Columns.Add(ColName1);
            DatagridAvan1.ItemsSource = applist;
            for (int i = 0; i < applist.Count; i++)
            {
                UpdateStuff hello     = applist[i];
                string      Appsnames = hello.AppName;
                string      appverss  = hello.AppVers;
            }
        }
示例#3
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        sensors  = new Dictionary <string, GameObject>();
        foreach (Transform child in sensorsParent.transform)
        {
            //Debug.Log("loaded " + child.name);
            sensors.Add(child.name, child.gameObject);
        }

        /*buttons = new Dictionary<string, GameObject>();
         * foreach (Transform child in buttonsParent.transform)
         * {
         *  Debug.Log("loaded " + child.name);
         *  buttons.Add(child.name, child.gameObject);
         * }*/

        //this.UpdateSensor("temp1", "hello"); //debuggin
    }