Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# loop through the registry searching for keys containing


// Below is a sample code that illustrates how to query for a given
// Value 'VisualStudio' in the HKLMSOFTWAREMicrosoft tree.


using System;
using System.Runtime.InteropServices;
using LogQuery = Interop.MSUtil.LogQueryClass;
using RegistryInputFormat = Interop.MSUtil.COMRegistryInputContextClass;
using RegRecordSet = Interop.MSUtil.ILogRecordset;

class Program
{
	public static void Main()
	{
		RegRecordSet rs = null;
		try
		{
			LogQuery qry = new LogQuery();
			RegistryInputFormat registryFormat = new RegistryInputFormat();
			string query = @"SELECT Path from HKLMSOFTWAREMicrosoft where
			Value='VisualStudio'";
			rs = qry.Execute(query, registryFormat);
			for(; !rs.atEnd(); rs.moveNext())
				Console.WriteLine(rs.getRecord().toNativeString(","));
		}
		finally
		{
			rs.close();
		}
	}
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to see if a number is even c# 
Csharp :: iframe set html content c# 
Csharp :: C# xamaring form change text on label 
Csharp :: select distinct two columns entity framework c# 
Csharp :: c# shorthand if statement without else 
Csharp :: how to decrease velocity of a Unity rigidbody 
Csharp :: unity audio source 
Csharp :: convert string to decimal c# 
Csharp :: remove from list based on condition c# 
Csharp :: how to access asp button of gridview 
Csharp :: c# compare dateTime with string 
Csharp :: c# .equals vs == 
Csharp :: c# remove invalid directory characters 
Csharp :: asp net saber ip address of client machine IIS 
Csharp :: unity pickup and drop objects 
Csharp :: superscript list 
Csharp :: Make UI/Canvas look at Camera always. 
Csharp :: How to create a Blazor server-side application in command prompt 
Csharp :: unity rigidbody freeze all rotation 
Csharp :: how to print to printer in c# 
Csharp :: Show empty message in data table angular material, If no data found 
Csharp :: c# try parse date yyyymmdd 
Csharp :: find gameobject by name in root 
Csharp :: c# while true loop 
Csharp :: how to iterate a generic list in c# 
Csharp :: textbox gotfocus wpf 
Csharp :: c# reflection get property value array 
Csharp :: how to insert data into multiple tables using asp.net c# 
Csharp :: dotnet add package 
Csharp :: c# get all id of list object 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =