Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

search of specified registry key


// 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 :: print pdf in c# 
Csharp :: c# for 
Csharp :: c# add strings 
Csharp :: vb.net center form in screen 
Csharp :: password regex asp.net 
Csharp :: freeze scene unity 
Csharp :: convert path to uri c# 
Csharp :: c# bootstrap checkbox 
Csharp :: jagged array to 2d array c# 
Csharp :: How to use the protected keyword in C# 
Csharp :: checkbox in c# 
Csharp :: check if two date ranges overlap c# 
Csharp :: Remove access to admin from deleting the file in C# 
Csharp :: aspx receive variable from url 
Csharp :: c#l list<string initialize 
Csharp :: monogame delta 
Csharp :: telerik mvc grid column with icon 
Csharp :: winform fixed size 
Csharp :: top down view player movement 
Csharp :: irrrtate throught an matrix c# 
Csharp :: c# integer part of float 
Csharp :: unity find all scriptable objects of a type 
Csharp :: unity stop physics 
Csharp :: Get location in Xamarin - NAYCode.com 
Csharp :: c# unit test exception using try catch 
Csharp :: DataGridView ComboBox column selection changed event 
Csharp :: select many vs select 
Csharp :: Save variable unity 
Csharp :: c sharp async 
Csharp :: linq c# where condition 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =