Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

search for a substring 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 :: C# loop through the registry searching for keys containing 
Csharp :: c# get a value from value tuple list 
Csharp :: C# program lambda Func 
Csharp :: c# destroy function...unity 
Csharp :: cmd move directory to another directory 
Csharp :: player input manager join manually 
Csharp :: c# tab select tab 
Csharp :: c# datagridview set column header alignment 
Csharp :: httpclient 
Csharp :: rotation 
Csharp :: c# validate xml 
Csharp :: csharp Console.Read(); 
Csharp :: unity werfen mit höhe 
Csharp :: select specific columns from datatable in c# using lambda 
Csharp :: go right unity 
Csharp :: monegame deltatime 
Csharp :: null-conditional operators c# 
Csharp :: translate int to string with x 0 before c# 
Csharp :: how to detect ajax request in asp.net core 
Csharp :: devexpress spreadsheet document source wpf 
Csharp :: How to decode Microsoft Local token in service 
Csharp :: unity collapse hierarchy script 
Csharp :: how to iterate string in c# 
Csharp :: how to make a system to check if i see certain object in unity 
Csharp :: load information with txt file to uwp c# 
Csharp :: c# listview add items horizontally 
Csharp :: check if list contains any empty element in c# 
Csharp :: c# slice array 
Csharp :: Generic Stack in c# 
Csharp :: how to create class in c# 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =