本文整理汇总了C#中System.Security.PermissionSet.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# PermissionSet.Equals方法的具体用法?C# PermissionSet.Equals怎么用?C# PermissionSet.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.PermissionSet
的用法示例。
在下文中一共展示了PermissionSet.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Hex_BigEndianUnicode_Permission
public void Hex_BigEndianUnicode_Permission ()
{
SecurityPermission sp = new SecurityPermission (SecurityPermissionFlag.Assertion);
PermissionSet ps = new PermissionSet (PermissionState.None);
ps.AddPermission (sp);
PermissionSetAttribute a = new PermissionSetAttribute (SecurityAction.Assert);
a.UnicodeEncoded = true;
a.Hex = "003C005000650072006D0069007300730069006F006E00530065007400200063006C006100730073003D002200530079007300740065006D002E00530065006300750072006900740079002E005000650072006D0069007300730069006F006E0053006500740022000D000A00760065007200730069006F006E003D002200310022003E000D000A003C0049005000650072006D0069007300730069006F006E00200063006C006100730073003D002200530079007300740065006D002E00530065006300750072006900740079002E005000650072006D0069007300730069006F006E0073002E00530065006300750072006900740079005000650072006D0069007300730069006F006E002C0020006D00730063006F0072006C00690062002C002000560065007200730069006F006E003D0032002E0030002E0033003600300030002E0030002C002000430075006C0074007500720065003D006E00650075007400720061006C002C0020005000750062006C00690063004B006500790054006F006B0065006E003D00620037003700610035006300350036003100390033003400650030003800390022000D000A00760065007200730069006F006E003D002200310022000D000A0046006C006100670073003D00220041007300730065007200740069006F006E0022002F003E000D000A003C002F005000650072006D0069007300730069006F006E005300650074003E000D000";
PermissionSet psbeu = a.CreatePermissionSet ();
Assert.IsTrue (ps.Equals (psbeu), "HEX-BIGENDIAN-UNICODE");
}
示例2: Hex_ASCII_Permission
public void Hex_ASCII_Permission ()
{
SecurityPermission sp = new SecurityPermission (SecurityPermissionFlag.Assertion);
PermissionSet ps = new PermissionSet (PermissionState.None);
ps.AddPermission (sp);
PermissionSetAttribute a = new PermissionSetAttribute (SecurityAction.Assert);
a.Hex = "3C5065726D697373696F6E53657420636C6173733D2253797374656D2E53656375726974792E5065726D697373696F6E536574220D0A76657273696F6E3D2231223E0D0A3C495065726D697373696F6E20636C6173733D2253797374656D2E53656375726974792E5065726D697373696F6E732E53656375726974795065726D697373696F6E2C206D73636F726C69622C2056657273696F6E3D322E302E333630302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D62373761356335363139333465303839220D0A76657273696F6E3D2231220D0A466C6167733D22417373657274696F6E222F3E0D0A3C2F5065726D697373696F6E5365743E0D0A";
PermissionSet psa = a.CreatePermissionSet ();
Assert.IsTrue (ps.Equals (psa), "HEX-ASCII");
}