Querying the registry
You must be thinking, "Why do we need to query the registry with NAV?" Just take this recipe as an option.
How to do it...
Let's create a new
Class Library
project in Visual Studio.Create a new file in the class with the following code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using Microsoft.Win32; namespace RegistryQuery { [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId("RegistryQuery")] [ComVisible(true)] public class RegistryQuery { public string GetKeyValue(string key, string name) { RegistryKey regKey = Registry.Users.OpenSubKey(key); if (regKey == null) { return "Key not found!"; } else { object value = regKey.GetValue(name); if (value != null) { return value.ToString(); ...