c# - How to get registry keys and values in listview -
How to get all the registry strings and values in the list view? Example:
Registry Key Key = Registry Local. OpenSubUKI (@ "Software \ Microsoft \ Windows Current Version / Run"); (Int i = 0; i & lt; key.ValueCount; i ++) {string [] arr2 = {key.GetSubKeyNames (), ""}; ListViewItem Item = New ListViewItem (arr2); ListView1.Items.Add (item); }
Registry location: HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run and HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows CurrentVersion \ Run
listView1.View = see.nude; ListView1.Columns.Add ("name", 150); ListView1.Columns.Add ("Data", 300); Registry key key = Registry. OpenSubUKI (@ "Software \ Microsoft \ Windows Current Version / Run"); Foreach (string key name key.GetValueNames ()) {listView1.Items.Add (New ListViewItem (new string [] {keyName, key.GetValue (keyName). ToString ()})); }
Comments
Post a Comment