• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RegistryPermissionAccess类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetPathList

		public string GetPathList (RegistryPermissionAccess access)
		{
			switch (access) {
				case RegistryPermissionAccess.AllAccess:
				case RegistryPermissionAccess.NoAccess:
					ThrowInvalidFlag (access, true);
					break;
				case RegistryPermissionAccess.Create:
					return GetPathList (createList);
				case RegistryPermissionAccess.Read:
					return GetPathList (readList);
				case RegistryPermissionAccess.Write:
					return GetPathList (writeList);
				default:
					ThrowInvalidFlag (access, false);
					break;
			}
			return null; // never reached
		}
开发者ID:runefs,项目名称:Marvin,代码行数:19,代码来源:RegistryPermission.cs


示例17: RegistryPermission

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


示例18: ExclusiveAccess

        private void ExclusiveAccess( RegistryPermissionAccess access ) 
        {
            if (access == RegistryPermissionAccess.NoAccess) 
            {
                throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
            }
 
            if (((int) access & ((int)access-1)) != 0)
            { 
                throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") ); 
            }
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:12,代码来源:RegistryPermission.cs


示例19: VerifyAccess

 private void VerifyAccess( RegistryPermissionAccess access )
 {
     if ((access & ~RegistryPermissionAccess.AllAccess) != 0)
         throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)access)); 
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:5,代码来源:RegistryPermission.cs


示例20: GetValueCreatePermission

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RegistryRights类代码示例发布时间:2022-05-24
下一篇:
C# RegistryOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap