/// <summary>
        /// Returns the correct Input Context class for this type of query. It will also sanity check
        /// all relevant config params and throw exceptions where there are violations (required
        /// setting missing, badly formed etc)
        /// </summary>
        /// <returns></returns>
        /// <exception cref="ArgumentException">Thrown if a setting is missing</exception>
        /// <exception cref="FormatException">Thrown if a setting is badly formed</exception>
        protected override object GetInputContext()
        {
            var context = new COMRegistryInputContextClass
            {
                recurse      = myConfig.Recurse ?? -1,
                multiSZSep   = myConfig.MultiSZSep ?? "|",
                binaryFormat = myConfig.BinaryFormat ?? "ASC"
            };

            return(context);
        }
示例#2
0
        static List <string> ScanRegistry()
        {
            List <string> keys = new List <string>();
            ILogRecordset rs   = null;

            try
            {
                LogQueryClass logQ = new LogQueryClass();
                COMRegistryInputContextClass registryFormat = new COMRegistryInputContextClass();
                string query = @"SELECT Path FROM \ where Value LIKE 'o2Mate%'";
                rs = logQ.Execute(query, registryFormat);
                for (; !rs.atEnd(); rs.moveNext())
                {
                    keys.Add(rs.getRecord().toNativeString(","));
                }
            }
            finally
            {
                rs.close();
            }
            return(keys);
        }