本文整理汇总了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));
}