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


C# EnvironmentPermission.GetPathList方法代碼示例

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


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

示例1: FromXml

		public void FromXml () 
		{
			EnvironmentPermission ep = new EnvironmentPermission (PermissionState.None);
			SecurityElement se = ep.ToXml ();
			AssertNotNull ("ToXml()", se);
			ep.FromXml (se);
			se.AddAttribute ("Read", envVariables);
			ep.FromXml (se);
			AssertEquals ("FromXml-Read", envVariables, ep.GetPathList (EnvironmentPermissionAccess.Read));
			se.AddAttribute ("Write", envVariables);
			ep.FromXml (se);
			AssertEquals ("FromXml-Read", envVariables, ep.GetPathList (EnvironmentPermissionAccess.Read));
			AssertEquals ("FromXml-Write", envVariables, ep.GetPathList (EnvironmentPermissionAccess.Write));
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:14,代碼來源:EnvironmentPermissionTest.cs

示例2: GetPathList

		public void GetPathList () 
		{
			EnvironmentPermission ep = new EnvironmentPermission (PermissionState.None);
#if NET_2_0
			AssertEquals ("GetPathList-Read-Empty", String.Empty, ep.GetPathList (EnvironmentPermissionAccess.Read));
			AssertEquals ("GetPathList-Write-Empty", String.Empty, ep.GetPathList (EnvironmentPermissionAccess.Write));
#else
			AssertNull ("GetPathList-Read-Empty", ep.GetPathList (EnvironmentPermissionAccess.Read));
			AssertNull ("GetPathList-Write-Empty", ep.GetPathList (EnvironmentPermissionAccess.Write));
#endif
			ep.AddPathList (EnvironmentPermissionAccess.Read, "UID");
			ep.AddPathList (EnvironmentPermissionAccess.Write, "PROMPT");
			AssertEquals ("GetPathList-Read", "UID", ep.GetPathList (EnvironmentPermissionAccess.Read));
			AssertEquals ("GetPathList-Write", "PROMPT", ep.GetPathList (EnvironmentPermissionAccess.Write));
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:15,代碼來源:EnvironmentPermissionTest.cs

示例3: GetPathListNoAccess

		public void GetPathListNoAccess () 
		{
			EnvironmentPermission ep = new EnvironmentPermission (PermissionState.None);
			ep.AddPathList (EnvironmentPermissionAccess.Read, "UID");
			ep.AddPathList (EnvironmentPermissionAccess.Write, "PROMPT");
			AssertEquals ("GetPathList-NoAccess", "", ep.GetPathList (EnvironmentPermissionAccess.NoAccess));
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:7,代碼來源:EnvironmentPermissionTest.cs

示例4: GetEnvironmentPermission

		private static string GetEnvironmentPermission (EnvironmentPermission ep)
		{
			if (ep.IsUnrestricted ())
				return "  EnvironmentPermission - Unrestricted\\l";

			StringBuilder sb = new StringBuilder ("  EnvironmentPermission\\l");
			string s = ep.GetPathList (EnvironmentPermissionAccess.Read);
			if ((s != null) && (s.Length > 0))
				sb.AppendFormat ("    Read: {0}\\l", s);
			s = ep.GetPathList (EnvironmentPermissionAccess.Write);
			if ((s != null) && (s.Length > 0))
				sb.AppendFormat ("    Write: {0}\\l", s);
			return sb.ToString ();
		}
開發者ID:transformersprimeabcxyz,項目名稱:cecil-old,代碼行數:14,代碼來源:CallerAnalysisVisualizer.cs

示例5: GetPathListAllAccess

		public void GetPathListAllAccess () 
		{
			EnvironmentPermission ep = new EnvironmentPermission (PermissionState.None);
			ep.AddPathList (EnvironmentPermissionAccess.Read, "UID");
			ep.AddPathList (EnvironmentPermissionAccess.Write, "PROMPT");
			Assert.AreEqual ("", ep.GetPathList (EnvironmentPermissionAccess.AllAccess), "GetPathList-AllAccess");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:7,代碼來源:EnvironmentPermissionTest.cs

示例6: GetPathList

		public void GetPathList () 
		{
			EnvironmentPermission ep = new EnvironmentPermission (PermissionState.None);
			Assert.AreEqual (String.Empty, ep.GetPathList (EnvironmentPermissionAccess.Read), "GetPathList-Read-Empty");
			Assert.AreEqual (String.Empty, ep.GetPathList (EnvironmentPermissionAccess.Write), "GetPathList-Write-Empty");
			ep.AddPathList (EnvironmentPermissionAccess.Read, "UID");
			ep.AddPathList (EnvironmentPermissionAccess.Write, "PROMPT");
			Assert.AreEqual ("UID", ep.GetPathList (EnvironmentPermissionAccess.Read), "GetPathList-Read");
			Assert.AreEqual ("PROMPT", ep.GetPathList (EnvironmentPermissionAccess.Write), "GetPathList-Write");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:10,代碼來源:EnvironmentPermissionTest.cs


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