Programowanie mikrokontrolerów
mikrokontrolery24.pl
DataGridView
private void button11_Click(object sender, EventArgs e)
{
int b = 0;
dataGridView2.Visible = true;
dataGridView2.AllowUserToAddRows = true;
string registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey))
{
var query = from a in key.GetSubKeyNames()
let r = key.OpenSubKey(a)
select new
{
Application = r.GetValue("DisplayName"),
InstallLocation = r.GetValue("InstallLocation")
};
foreach (var item in query)
{
if (item.Application != null)
{
dataGridView2.Rows.Add();
richTextBox1.AppendText(item.Application + "");
richTextBox2.AppendText(item.InstallLocation + "");
dataGridView2.Rows[b].Cells[0].Value = item.Application.ToString();
if (item.InstallLocation != null)
{
dataGridView2.Rows[b].Cells[1].Value = item.InstallLocation.ToString();
}
else { dataGridView2.Rows[b].Cells[1].Value = "Brak"; }
//Console.WriteLine(item.Application + " - " + item.InstallLocation);
b++;
}
}
}
}
09-lip-2024 19:45:51 CEST
by Pioter
Wszelkie prawa zastrzeżone! Kopiowanie, powielanie i wykorzystywanie zdjęć, treści oraz jej fragmentów bez zgody autora jest zabronione.
© mikroprocesory.info.pl@gmail.com 2013.
© mikroprocesory.info.pl@gmail.com 2013.