當前位置: 首頁>>代碼示例>>C#>>正文


C# EnvironmentPermission.SetPathList方法代碼示例

本文整理匯總了C#中System.Security.Permissions.EnvironmentPermission.SetPathList方法的典型用法代碼示例。如果您正苦於以下問題:C# EnvironmentPermission.SetPathList方法的具體用法?C# EnvironmentPermission.SetPathList怎麽用?C# EnvironmentPermission.SetPathList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Security.Permissions.EnvironmentPermission的用法示例。


在下文中一共展示了EnvironmentPermission.SetPathList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreatePermission

 public override IPermission CreatePermission()
 {
     if (base.m_unrestricted)
     {
         return new EnvironmentPermission(PermissionState.Unrestricted);
     }
     EnvironmentPermission permission = new EnvironmentPermission(PermissionState.None);
     if (this.m_read != null)
     {
         permission.SetPathList(EnvironmentPermissionAccess.Read, this.m_read);
     }
     if (this.m_write != null)
     {
         permission.SetPathList(EnvironmentPermissionAccess.Write, this.m_write);
     }
     return permission;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:17,代碼來源:EnvironmentPermissionAttribute.cs

示例2: Copy

		public override IPermission Copy ()
		{
			EnvironmentPermission ep = new EnvironmentPermission (_state);
			string path = GetPathList (EnvironmentPermissionAccess.Read);
			if (path != null)
				ep.SetPathList (EnvironmentPermissionAccess.Read, path);
			path = GetPathList (EnvironmentPermissionAccess.Write);
			if (path != null)
				ep.SetPathList (EnvironmentPermissionAccess.Write, path);
			return ep;
		}
開發者ID:runefs,項目名稱:Marvin,代碼行數:11,代碼來源:EnvironmentPermission.cs

示例3: CreatePermission

 public override IPermission CreatePermission()
 {
     if (m_unrestricted)
     {
         return new EnvironmentPermission(PermissionState.Unrestricted);
     }
     else
     {
         EnvironmentPermission perm = new EnvironmentPermission(PermissionState.None);
         if (m_read != null)
             perm.SetPathList( EnvironmentPermissionAccess.Read, m_read );
         if (m_write != null)
             perm.SetPathList( EnvironmentPermissionAccess.Write, m_write );
         return perm;
     }
 }
開發者ID:destinyclown,項目名稱:coreclr,代碼行數:16,代碼來源:PermissionAttributes.cs

示例4: SetPathList

		public void SetPathList () 
		{
			EnvironmentPermission ep = new EnvironmentPermission (PermissionState.None);
			ep.SetPathList (EnvironmentPermissionAccess.AllAccess, envVariables);
			// LAMESPEC NoAccess do not remove the TMP from AllAccess
			ep.SetPathList (EnvironmentPermissionAccess.NoAccess, "SYSTEMROOT");
			ep.SetPathList (EnvironmentPermissionAccess.Read, "UID");
			ep.SetPathList (EnvironmentPermissionAccess.Write, "PROMPT");
			SecurityElement se = ep.ToXml ();
			AssertEquals ("SetPathList-ToXml-Read", "UID", (se.Attributes ["Read"] as string));
			AssertEquals ("SetPathList-ToXml-Write", "PROMPT", (se.Attributes ["Write"] as string));
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:12,代碼來源:EnvironmentPermissionTest.cs


注:本文中的System.Security.Permissions.EnvironmentPermission.SetPathList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。