ReadStringFromKey() public static method

public static ReadStringFromKey ( RegistryKey rootKey, string keyName, string valueName ) : string
rootKey Microsoft.Win32.RegistryKey
keyName string
valueName string
return string
Esempio n. 1
0
        private void LoadFromKey(RegistryKey key)
        {
            string name = key.GetValue(null) as string;

            if (!String.IsNullOrWhiteSpace(name))
            {
                Name = COMUtilities.DemangleWinRTName(name.ToString());
                CacheIidToName(Iid, Name);
            }
            else
            {
                Name = Iid.FormatGuidDefault();
            }

            ProxyClsid = COMUtilities.ReadGuidFromKey(key, "ProxyStubCLSID32", null);
            NumMethods = COMUtilities.ReadIntFromKey(key, "NumMethods", null);

            if (NumMethods < 3)
            {
                NumMethods = 3;
            }

            TypeLib        = COMUtilities.ReadGuidFromKey(key, "TypeLib", null);
            TypeLibVersion = COMUtilities.ReadStringFromKey(key, "TypeLib", "Version");
            Base           = COMUtilities.ReadStringFromKey(key, "BaseInterface", null);
            if (Base.Length == 0)
            {
                Base = "IUnknown";
            }
        }
 internal COMCLSIDServerDotNetEntry(RegistryKey key)
 {
     AssemblyName   = COMUtilities.ReadStringFromKey(key, null, "Assembly");
     ClassName      = COMUtilities.ReadStringFromKey(key, null, "Class");
     CodeBase       = COMUtilities.ReadStringFromKey(key, null, "CodeBase");
     RuntimeVersion = COMUtilities.ReadStringFromKey(key, null, "RuntimeVersion");
 }
        private void LoadFromKey(RegistryKey key)
        {
            object name = key.GetValue(null);

            if ((name != null) && (name.ToString().Length > 0))
            {
                Name = name.ToString();
            }
            else
            {
                Name = String.Format("{{{0}}}", Iid.ToString());
            }

            ProxyClsid = COMUtilities.ReadGuidFromKey(key, "ProxyStubCLSID32", null);
            NumMethods = COMUtilities.ReadIntFromKey(key, "NumMethods", null);

            if (NumMethods < 3)
            {
                NumMethods = 3;
            }

            TypeLib        = COMUtilities.ReadGuidFromKey(key, "TypeLib", null);
            TypeLibVersion = COMUtilities.ReadStringFromKey(key, "TypeLib", "Version");

            Base = COMUtilities.ReadStringFromKey(key, "BaseInterface", null);
            if (Base.Length == 0)
            {
                Base = "IUnknown";
            }
        }
Esempio n. 4
0
 private void LoadFromKey(RegistryKey key)
 {
     Clsid          = COMUtilities.ReadGuidFromKey(key, null, "CLSID");
     ActivationType = (ActivationType)COMUtilities.ReadIntFromKey(key, null, "ActivationType");
     TrustLevel     = (TrustLevel)COMUtilities.ReadIntFromKey(key, null, "TrustLevel");
     Threading      = COMUtilities.ReadIntFromKey(key, null, "Threading");
     DllPath        = COMUtilities.ReadStringFromKey(key, null, "DllPath");
     Server         = COMUtilities.ReadStringFromKey(key, null, "Server");
     Permissions    = string.Empty;
     byte[] permissions = key.GetValue("Permissions", new byte[0]) as byte[];
     Permissions = COMSecurity.GetStringSDForSD(permissions);
 }
 private void LoadFromKey(RegistryKey key)
 {
     IdentityType   = (IdentityType)COMUtilities.ReadIntFromKey(key, null, "IdentityType");
     ServerType     = (ServerType)COMUtilities.ReadIntFromKey(key, null, "ServerType");
     InstancingType = (InstancingType)COMUtilities.ReadIntFromKey(key, null, "InstancingType");
     Identity       = COMUtilities.ReadStringFromKey(key, null, "Identity");
     ServiceName    = COMUtilities.ReadStringFromKey(key, null, "ServiceName");
     ExePath        = COMUtilities.ReadStringFromKey(key, null, "ExePath");
     Permissions    = string.Empty;
     byte[] permissions = key.GetValue("Permissions", new byte[0]) as byte[];
     Permissions = COMSecurity.GetStringSDForSD(permissions);
 }
        internal COMCLSIDElevationEntry(RegistryKey key, RegistryKey vso_key, bool auto_approval)
        {
            Enabled       = COMUtilities.ReadIntFromKey(key, null, "Enabled") != 0;
            IconReference = COMUtilities.ReadStringFromKey(key, null, "IconReference");
            HashSet <Guid> vsos = new HashSet <Guid>();

            if (vso_key != null)
            {
                foreach (string value in vso_key.GetValueNames())
                {
                    if (COMUtilities.IsValidGUID(value))
                    {
                        vsos.Add(new Guid(value));
                    }
                }
            }
            AutoApproval         = auto_approval;
            VirtualServerObjects = new List <Guid>(vsos).AsReadOnly();
        }
 internal COMAppIDServiceEntry(RegistryKey key,
                               ServiceController service)
 {
     DisplayName = service.DisplayName;
     Name        = service.ServiceName;
     ServiceType = service.ServiceType;
     ServiceDll  = String.Empty;
     ImagePath   = String.Empty;
     UserName    = String.Empty;
     if (key != null)
     {
         UserName   = COMUtilities.ReadStringFromKey(key, null, "ObjectName");
         ImagePath  = COMUtilities.ReadStringFromKey(key, null, "ImagePath");
         ServiceDll = COMUtilities.ReadStringFromKey(key, "Parameters", "ServiceDll");
         if (String.IsNullOrEmpty(ServiceDll))
         {
             ServiceDll = COMUtilities.ReadStringFromKey(key, null, "ServiceDll");
         }
     }
 }
Esempio n. 8
0
        private void LoadFromKey(RegistryKey key)
        {
            var custom_properties = new Dictionary <string, string>();

            using (var prop_key = key.OpenSubKeySafe("CustomProperties"))
            {
                if (prop_key != null)
                {
                    foreach (var value_name in prop_key.GetValueNames())
                    {
                        custom_properties[value_name] = prop_key.GetValue(value_name).ToString();
                    }
                }
            }
            CustomProperties = custom_properties;
            Description      = COMUtilities.ReadStringFromKey(key, null, "Description");
            DisplayName      = COMUtilities.ReadStringFromKey(key, null, "DisplayName");
            Icon             = COMUtilities.ReadStringFromKey(key, null, "Icon");
            Vendor           = COMUtilities.ReadStringFromKey(key, null, "Vendor");
        }