Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

searching for keys in the registry


// 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 :: search of specified registry key 
Csharp :: for jump script unity 2d 
Csharp :: how to sort a dictionary by value in c# 
Csharp :: max index array c# 
Csharp :: timer unity 
Csharp :: c# create log file 
Csharp :: async await c# 
Csharp :: vb.net datagridview set row index 
Csharp :: c# write line 
Csharp :: Get all images from folder asp.net 
Csharp :: csharp bubble sort 
Csharp :: foreach c# linq example 
Csharp :: c# array zaheln speichern 
Csharp :: unity scene switch 
Csharp :: ArgumentException: Input Key named: Fire1 is unknown 
Csharp :: int array to frequency dictionary c# 
Csharp :: c# listview filter contains 
Csharp :: C# webclient submit form 
Csharp :: unity reload active scene 
Csharp :: c# invokerequired wpf 
Csharp :: linear search algorithm c# 
Csharp :: install nuget package for S3 
Csharp :: how to call an If statement only once in C# 
Csharp :: reference a class by string unity 
Csharp :: last index for array c# 
Csharp :: c# copy bidimensional array 
Csharp :: c# in equivalent 
Csharp :: list add value position c# 
Csharp :: Generic Stack 
Csharp :: c# split string 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =