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


C# RegistryPermissionAccess类代码示例

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


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

示例1: AddPathList

		// Properties

		// Methods

		public void AddPathList (RegistryPermissionAccess access, string pathList) 
		{
			if (pathList == null)
				throw new ArgumentNullException ("pathList");

			switch (access) {
				case RegistryPermissionAccess.AllAccess:
					AddWithUnionKey (createList, pathList);
					AddWithUnionKey (readList, pathList);
					AddWithUnionKey (writeList, pathList);
					break;
				case RegistryPermissionAccess.NoAccess:
					// ??? unit tests doesn't show removal using NoAccess ???
					break;
				case RegistryPermissionAccess.Create:
					AddWithUnionKey (createList, pathList);
					break;
				case RegistryPermissionAccess.Read:
					AddWithUnionKey (readList, pathList);
					break;
				case RegistryPermissionAccess.Write:
					AddWithUnionKey (writeList, pathList);
					break;
				default:
					ThrowInvalidFlag (access, false);
					break;
			}
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:32,代码来源:RegistryPermission.cs

示例2: RegistryPermission

	public RegistryPermission(RegistryPermissionAccess flag, String pathList)
			{
				if(pathList == null)
				{
					throw new ArgumentNullException("pathList");
				}
				if((flag & ~(RegistryPermissionAccess.AllAccess)) != 0)
				{
					throw new ArgumentException(_("Arg_RegistryAccess"));
				}
				this.state = PermissionState.None;
				String[] split = EnvironmentPermission.SplitPath(pathList);
				if((flag & RegistryPermissionAccess.Read) != 0)
				{
					readList = split;
				}
				if((flag & RegistryPermissionAccess.Write) != 0)
				{
					writeList = split;
				}
				if((flag & RegistryPermissionAccess.Create) != 0)
				{
					createList = split;
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:25,代码来源:RegistryPermission.cs

示例3: AddPathList

     public void AddPathList( RegistryPermissionAccess access, AccessControlActions control, String pathList )
     {
         VerifyAccess( access );
         
         if ((access & RegistryPermissionAccess.Read) != 0)
         {
             if (m_read == null)
                 m_read = new StringExpressionSet();
             m_read.AddExpressions( pathList );
         }
         
         if ((access & RegistryPermissionAccess.Write) != 0)
         {
             if (m_write == null)
                 m_write = new StringExpressionSet();
             m_write.AddExpressions( pathList );
         }
 
         if ((access & RegistryPermissionAccess.Create) != 0)
         {
             if (m_create == null)
                 m_create = new StringExpressionSet();
             m_create.AddExpressions( pathList );
         }
     }
开发者ID:kouvel,项目名称:coreclr,代码行数:25,代码来源:RegistryPermission.cs

示例4: RegistryPermission

		public RegistryPermission (RegistryPermissionAccess access, string pathList)
		{
			_state = PermissionState.None;
			createList = new ArrayList ();
			readList = new ArrayList ();
			writeList = new ArrayList ();
			AddPathList (access, pathList);
		}
开发者ID:runefs,项目名称:Marvin,代码行数:8,代码来源:RegistryPermission.cs

示例5: HavePermissionsOnKey

 public static bool HavePermissionsOnKey(this RegistryPermission reg, RegistryPermissionAccess accessLevel, string key)
 {
     try
     {
         RegistryPermission r = new RegistryPermission(accessLevel, key);
         r.Demand();
         return true;
     }
     catch (SecurityException)
     {
         return false;
     }
 }
开发者ID:WELL-E,项目名称:Hurricane,代码行数:13,代码来源:RegistryExtensions.cs

示例6: HavePermissionsOnKey

 protected bool HavePermissionsOnKey(RegistryPermissionAccess accessLevel, string key)
 {
     try
     {
         RegistryPermission r = new RegistryPermission(accessLevel, key);
         r.Demand();
         return true;
     }
     catch (SecurityException)
     {
         return false;
     }
 }
开发者ID:WELL-E,项目名称:Hurricane,代码行数:13,代码来源:RegistryContextMenuItem.cs

示例7: SetPathList

        [System.Security.SecuritySafeCritical]  // auto-generated 
        public void SetPathList( RegistryPermissionAccess access, String pathList )
        { 
            VerifyAccess( access );

            m_unrestricted = false;
 
            if ((access & RegistryPermissionAccess.Read) != 0)
                m_read = null; 
 
            if ((access & RegistryPermissionAccess.Write) != 0)
                m_write = null; 

            if ((access & RegistryPermissionAccess.Create) != 0)
                m_create = null;
 
            AddPathList( access, pathList );
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:18,代码来源:RegistryPermission.cs

示例8: GetSubTreeReadWritePermission

 private void GetSubTreeReadWritePermission(string subkeyName, out RegistryPermissionAccess access, out string path) {
     access = RegistryPermissionAccess.Write | RegistryPermissionAccess.Read;
     path   = keyName + "\\" + subkeyName;
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:4,代码来源:RegistryKey.cs

示例9: GetSubKeyWritePermission

 private void GetSubKeyWritePermission(string subkeyName, out RegistryPermissionAccess access, out string path) {
     // If we want to open a subkey of a read-only key as writeable, we need to do the check.
     access = RegistryPermissionAccess.Write;
     path   = keyName + "\\" + subkeyName + "\\.";
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:5,代码来源:RegistryKey.cs

示例10: GetSubKeyCreatePermission

 private void GetSubKeyCreatePermission(string subkeyName, out RegistryPermissionAccess access, out string path) {
     access = RegistryPermissionAccess.Create;
     path   = keyName + "\\" + subkeyName + "\\."; 
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:4,代码来源:RegistryKey.cs

示例11: GetPathList

     public String GetPathList( RegistryPermissionAccess access )
     {
         // SafeCritical: these are registry paths, which means we're not leaking file system information here
         VerifyAccess( access );
         ExclusiveAccess( access );
 
         if ((access & RegistryPermissionAccess.Read) != 0)
         {
             if (m_read == null)
             {
                 return "";
             }
             return m_read.UnsafeToString();
         }
         
         if ((access & RegistryPermissionAccess.Write) != 0)
         {
             if (m_write == null)
             {
                 return "";
             }
             return m_write.UnsafeToString();
         }
 
         if ((access & RegistryPermissionAccess.Create) != 0)
         {
             if (m_create == null)
             {
                 return "";
             }
             return m_create.UnsafeToString();
         }
         
         /* not reached */
         
         return "";
     }     
开发者ID:l1183479157,项目名称:coreclr,代码行数:37,代码来源:RegistryPermission.cs

示例12: RegistryPermission

        public RegistryPermission (RegistryPermissionAccess access, string pathList) {

          return default(RegistryPermission);
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:4,代码来源:System.Security.Permissions.RegistryPermission.cs

示例13: GetPathList

 public string GetPathList(RegistryPermissionAccess access)
 {
   return default(string);
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:4,代码来源:System.Security.Permissions.RegistryPermission.cs

示例14: GetPathList

        public String GetPathList( RegistryPermissionAccess access ) 
        {
            VerifyAccess( access );
            ExclusiveAccess( access );
 
            if ((access & RegistryPermissionAccess.Read) != 0)
            { 
                if (m_read == null) 
                {
                    return ""; 
                }
                return m_read.ToString();
            }
 
            if ((access & RegistryPermissionAccess.Write) != 0)
            { 
                if (m_write == null) 
                {
                    return ""; 
                }
                return m_write.ToString();
            }
 
            if ((access & RegistryPermissionAccess.Create) != 0)
            { 
                if (m_create == null) 
                {
                    return ""; 
                }
                return m_create.ToString();
            }
 
            /* not reached */
 
            return ""; 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:36,代码来源:RegistryPermission.cs

示例15: AddPathList

 [System.Security.SecuritySafeCritical]  // auto-generated
 public void AddPathList( RegistryPermissionAccess access, String pathList ) 
 { 
     AddPathList( access, AccessControlActions.None, pathList );
 } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:5,代码来源:RegistryPermission.cs


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