本文整理匯總了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;
}
示例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;
}
}
示例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));
}