Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

finding 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 :: working with registry in c# 
Csharp :: print pdf in c# 
Csharp :: iframe set html content c# 
Csharp :: calculator in c# 
Csharp :: euler to quaternion 
Csharp :: c# make a automapper 
Csharp :: print c# 
Csharp :: hide numericUpDown arrows 
Csharp :: loop for specific time c# 
Csharp :: string interpolation in c# 
Csharp :: drop down list razor example 
Csharp :: reverse a linked list C# 
Csharp :: .net json result status code not working 
Csharp :: unity auto scroll 
Csharp :: c sharp teleporting 
Csharp :: c# window form align right bottom 
Csharp :: docker Test a Connection using Curl 
Csharp :: display array elemetns to text box c# 
Csharp :: C# top down view player movement 
Csharp :: dynamic add event control c# 
Csharp :: multi case in c# 
Csharp :: web client ignore ssl error 
Csharp :: unity stop velocity movement 
Csharp :: declare multiple variables in for loop C# 
Csharp :: raq query ef core 
Csharp :: Non-Serialized Fields in unity inspector 
Csharp :: add header in action asp.net mvc 
Csharp :: run in wpf 
Csharp :: c# sbyte 
Csharp :: c# Write a program to reverse an array or string 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =