के साथ स्थापित प्रोग्राम की एक सूची प्राप्त करें मुझे स्थानीय मशीन पर एप्लिकेशन आइकन के साथ स्थापित प्रोग्राम की एक सूची प्राप्त करने की आवश्यकता है। नीचे कोड स्निपेट है जो स्थापित प्रोग्राम की सूची और स्थापित निर्देशिका पथ प्राप्त करने के लिए उपयोग कर रहा है।एप्लिकेशन आइकन
/// <summary>
/// Gets a list of installed software and, if known, the software's install path.
/// </summary>
/// <returns></returns>
private string Getinstalledsoftware()
{
//Declare the string to hold the list:
string Software = null;
//The registry key:
string SoftwareKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(SoftwareKey))
{
//Let's go through the registry keys and get the info we need:
foreach (string skName in rk.GetSubKeyNames())
{
using (RegistryKey sk = rk.OpenSubKey(skName))
{
try
{
//If the key has value, continue, if not, skip it:
if (!(sk.GetValue("DisplayName") == null))
{
//Is the install location known?
if (sk.GetValue("InstallLocation") == null)
Software += sk.GetValue("DisplayName") + " - Install path not known\n"; //Nope, not here.
else
Software += sk.GetValue("DisplayName") + " - " + sk.GetValue("InstallLocation") + "\n"; //Yes, here it is...
}
}
catch (Exception ex)
{
//No, that exception is not getting away... :P
}
}
}
}
return Software;
}
अब समस्या यह है कि मैं स्थापित एप्लिकेशन आइकन कैसे प्राप्त कर सकता हूं?
अग्रिम धन्यवाद।
एक और बात यह है कि इसके बाद के संस्करण कोड भी शामिल है विंडो अपडेट, मैं उन कार्यक्रमों को कैसे बाहर कर सकता हूं? – MUS