本文整理汇总了C#中ObjectIdentifier.ToBytes方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectIdentifier.ToBytes方法的具体用法?C# ObjectIdentifier.ToBytes怎么用?C# ObjectIdentifier.ToBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectIdentifier
的用法示例。
在下文中一共展示了ObjectIdentifier.ToBytes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestToBytes2
public void TestToBytes2()
{
uint[] expected = new uint[] {0, 0};
ObjectIdentifier oid = new ObjectIdentifier(expected);
Assert.AreEqual(new byte[] {0x06, 0x01, 0x00}, oid.ToBytes());
}
示例2: TestToBytes3
public void TestToBytes3()
{
uint[] expected = new uint[] {1, 3, 6, 3255};
ObjectIdentifier oid = new ObjectIdentifier(expected);
Assert.AreEqual(new byte[] {0x06, 0x04, 0x2B, 0x06, 0x99, 0x37}, oid.ToBytes());
}
示例3: TestToBytes
public void TestToBytes()
{
uint[] expected = new uint[] {1,3,6,1,4,1,2162,1000,2};
ObjectIdentifier oid = new ObjectIdentifier(expected);
Assert.AreEqual(new byte[] { 0x06, 0x0A, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x90, 0x72, 0x87, 0x68, 0x02 }, oid.ToBytes());
}