Listing All The Installed Softwares In Computer Using .Net
2012-04-01 20:34
567 查看
We will be Accomplishing using the Windows Registry.
Main Registry to work here is : "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
Just Write Down The Following Code the Form's Loading Event (Form Contains No Control):
C#.NET
Output:
Downloads:
vb.net : Download
c#.net : Download
Main Registry to work here is : "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
Just Write Down The Following Code the Form's Loading Event (Form Contains No Control):
C#.NET
VB.NET Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim SoftwareKey As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products" Dim rk As RegistryKey rk = Registry.LocalMachine.OpenSubKey(SoftwareKey) Dim skname As String Dim sname As String = String.Empty Dim ListView1 As New ListView Me.Controls.Add(ListView1) ListView1.Dock = DockStyle.Fill ListView1.View = View.Details ListView1.Columns.Add("Installed Software") For Each skname In rk.GetSubKeyNames Try sname = Registry.LocalMachine.OpenSubKey(SoftwareKey).OpenSubKey(skname).OpenSubKey("InstallProperties").GetValue("DisplayName") ListView1.Items.Add(sname) Catch ex As Exception MsgBox(ex.Message) End Try Next ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent) End Sub
Output:
Downloads:
vb.net : Download
c#.net : Download
相关文章推荐
- 获取本机已安装的软件列表C#/VB.NET(Get the list of installed software in local pc)
- Discover the Design Patterns You're Already Using in the .NET Framework(MSDN)
- Using the ASP.NET 2.0 ReportViewer in Local Mode
- Along with all the above benefits, you cannot overlook the space efficiency and performance gains in using DataFrames and Dataset APIs for two reasons.
- Storing Binary Files Directly in the Database Using ASP.NET 2.0
- 【Visual Studio】The project appears to be under source control, but the associated source control plug-in is not installed on this computer
- Add COM and ActiveX Support in .NET Compact Framework Using Odyssey Software CFCOM
- 【转载】Using the Web Service Callbacks in the .NET Application
- Using the Enterprise Library Validation Application Block in ASP.NET - Part I
- Working with Data in ASP.NET 2.0 :: Using TemplateFields in the GridView Control
- Coding Best Practices Using DateTime in the .NET Framework
- Accessing DWG files not open in the AutoCAD editor using .NET
- Discover the Design Patterns You're Already Using in the .NET Framework
- Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-stand
- Using the Enterprise Library Validation Application Block in ASP.NET - Part II
- Using SQLXML Bulk Load in the .NET Environment
- Fw:Managing View State in ASP.NET 4 Using the New ViewStateMode Property
- Using the ASP.NET 2.0 ReportViewer in Local Mode
- Using the Index Server to create Query Page in asp.net
- [转]Using the Interop Activity in a .NET Framework 4 Workflow