当前位置: 首页>>代码示例>>C#>>正文


C# RegistryRights类代码示例

本文整理汇总了C#中RegistryRights的典型用法代码示例。如果您正苦于以下问题:C# RegistryRights类的具体用法?C# RegistryRights怎么用?C# RegistryRights使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RegistryRights类属于命名空间,在下文中一共展示了RegistryRights类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: base

	public RegistryAccessRule
				(String identity, RegistryRights registryRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AccessControlType type)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)registryRights, false, inheritanceFlags,
				   propagationFlags, type) {}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:RegistryAccessRule.cs

示例2: base

	public RegistryAuditRule
				(String identity, RegistryRights registryRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AuditFlags auditFlags)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)registryRights, false, inheritanceFlags,
				   propagationFlags, auditFlags) {}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:RegistryAuditRule.cs

示例3: RegistryAccessRule

		public RegistryAccessRule (IdentityReference identity,
					   RegistryRights registryRights,
					   InheritanceFlags inheritanceFlags,
					   PropagationFlags propagationFlags,
					   AccessControlType type)
			: this (identity, registryRights, false, inheritanceFlags, propagationFlags, type)
		{
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:8,代码来源:RegistryAccessRule.cs

示例4: RegistryAuditRule

		public RegistryAuditRule (string identity,
					  RegistryRights registryRights,
					  InheritanceFlags inheritanceFlags,
					  PropagationFlags propagationFlags,
					  AuditFlags flags)
			: this (new NTAccount (identity), registryRights, inheritanceFlags, propagationFlags, flags)
		{
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:8,代码来源:RegistryAuditRule.cs

示例5: RegistryAccessRule

		public RegistryAccessRule (IdentityReference identity,
					   RegistryRights registryRights,
					   InheritanceFlags inheritanceFlags,
					   PropagationFlags propagationFlags,
					   AccessControlType type)
			// FIXME: accessMask=0 likely causes an error
			: base (identity, 0, false, inheritanceFlags, propagationFlags, type)
		{
			this.rights = registryRights;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:10,代码来源:RegistryAccessRule.cs

示例6: SafeRegistryHandle

        public SafeRegistryHandle(RegistryHive hive, string key, RegistryRights samDesired)
            : base(true)
        {
            IntPtr handle;

            int result = UnsafeNativeMethods.RegOpenKeyEx(hive, key, 0, samDesired, out handle);
            if (result != 0)
            {
                throw new Win32Exception(result);
            }

            SetHandle(handle);
        }
开发者ID:vbfox,项目名称:win32iam,代码行数:13,代码来源:SafeRegistryHandle.cs

示例7: SetUserAccess

        private static void SetUserAccess(RegistryKey registryKey, IdentityReference user, RegistryRights accessType)
        {
            RegistrySecurity registrySecurity = registryKey.GetAccessControl();

            RegistryAccessRule rule = new RegistryAccessRule(
                user,
                accessType,
                InheritanceFlags.ContainerInherit,
                PropagationFlags.None,
                AccessControlType.Allow
            );

            registrySecurity.AddAccessRule(rule);

            registryKey.SetAccessControl(registrySecurity);
        }
开发者ID:LordBlacksun,项目名称:Allegiance-Community-Security-System,代码行数:16,代码来源:RegistryAccess.cs

示例8: DoesUserHaveAccess

        public static bool DoesUserHaveAccess(RegistryKey registryKey, string userNameOrSID, RegistryRights accessType)
        {
            RegistrySecurity registrySecurity = registryKey.GetAccessControl();

            foreach (RegistryAccessRule registryAccessRule in registrySecurity.GetAccessRules(true, true, typeof(NTAccount)))
            {
                IdentityReference sidIdentityReference = registryAccessRule.IdentityReference.Translate(typeof(SecurityIdentifier));

                if (
                    (userNameOrSID.Equals(registryAccessRule.IdentityReference.Value, StringComparison.InvariantCultureIgnoreCase) == true
                        || userNameOrSID.Equals(sidIdentityReference.Value, StringComparison.InvariantCultureIgnoreCase) == true)
                    && (registryAccessRule.RegistryRights & accessType) == accessType)
                    return true;
            }

            return false;
        }
开发者ID:LordBlacksun,项目名称:Allegiance-Community-Security-System,代码行数:17,代码来源:RegistryAccess.cs

示例9: OpenSubKey

		public RegistryKey OpenSubKey (string name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights)
		{
			return OpenSubKey (name, permissionCheck == RegistryKeyPermissionCheck.ReadWriteSubTree);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:4,代码来源:RegistryKey.cs

示例10: OpenSubKey

		public RegistryKey OpenSubKey (string name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights)
		{
			return OpenSubKey (name);
		}
开发者ID:tgiphil,项目名称:mono,代码行数:4,代码来源:RegistryKey.cs

示例11: RegistryAccessRule

 public RegistryAccessRule(String identity, RegistryRights registryRights, AccessControlType type) 
     : this(new NTAccount(identity), (int) registryRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:4,代码来源:RegistrySecurity.cs

示例12: OpenSubKey

 public RegistryKey OpenSubKey(String name, RegistryRights rights)
 {
     return InternalOpenSubKey(name, this.checkMode, (int)rights);
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:4,代码来源:RegistryKey.cs

示例13: InternalOpenSubKeyCore

        private RegistryKey InternalOpenSubKeyCore(string name, RegistryRights rights, bool throwOnPermissionFailure)
        {
            SafeRegistryHandle result = null;
            int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, ((int)rights | (int)_regView), out result);
            if (ret == 0 && !result.IsInvalid)
            {
                RegistryKey key = new RegistryKey(result, IsWritable((int)rights), false, _remoteKey, false, _regView);
                key._keyName = _keyName + "\\" + name;
                return key;
            }

            if (throwOnPermissionFailure)
            {
                if (ret == Interop.Errors.ERROR_ACCESS_DENIED || ret == Interop.Errors.ERROR_BAD_IMPERSONATION_LEVEL)
                {
                    // We need to throw SecurityException here for compatibility reason,
                    // although UnauthorizedAccessException will make more sense.
                    ThrowHelper.ThrowSecurityException(SR.Security_RegistryPermission);
                }
            }

            // Return null if we didn't find the key.
            return null;
        }
开发者ID:dotnet,项目名称:corefx,代码行数:24,代码来源:RegistryKey.Windows.cs

示例14: RegistryAccessRule

 public RegistryAccessRule(string identity, RegistryRights registryRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type);
开发者ID:ellismg,项目名称:corefx-progress,代码行数:1,代码来源:Microsoft.Win32.Registry.AccessControl.cs

示例15: RegCreateKeyEx

 static extern int RegCreateKeyEx(
             SafeRegistryHandle hKey,
             string lpSubKey,
             int Reserved,
             string lpClass,
             RegistryOptions dwOptions,
             RegistryRights samDesired,
             IntPtr lpSecurityAttributes,
             out SafeRegistryHandle phkResult,
             out int lpdwDisposition);
开发者ID:Xiaoqing,项目名称:main,代码行数:10,代码来源:_winreg.cs


注:本文中的RegistryRights类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。