本文整理汇总了C#中Domain.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# Domain.ToArray方法的具体用法?C# Domain.ToArray怎么用?C# Domain.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain.ToArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
private static IResourceRecord Create(Domain domain, int preference, Domain exchange, TimeSpan ttl)
{
byte[] pref = BitConverter.GetBytes((ushort) preference);
byte[] data = new byte[pref.Length + exchange.Size];
if (BitConverter.IsLittleEndian) {
Array.Reverse(pref);
}
pref.CopyTo(data, 0);
exchange.ToArray().CopyTo(data, pref.Length);
return new ResourceRecord(domain, data, RecordType.MX, RecordClass.IN, ttl);
}
示例2: NameServerResourceRecord
public NameServerResourceRecord(Domain domain, Domain nsDomain, TimeSpan ttl = default(TimeSpan))
: base(new ResourceRecord(domain, nsDomain.ToArray(), RecordType.NS, RecordClass.IN, ttl))
{
NSDomainName = nsDomain;
}
示例3: EmptyDomain
public void EmptyDomain() {
Domain domain = new Domain(Helper.GetArray<string>());
byte[] content = Helper.ReadFixture("Domain", "empty-label");
CollectionAssert.AreEqual(content, domain.ToArray());
}
示例4: DomainWithMultipleLabels
public void DomainWithMultipleLabels() {
Domain domain = new Domain(Helper.GetArray("www", "google", "com"));
byte[] content = Helper.ReadFixture("Domain", "www.google.com-label");
CollectionAssert.AreEqual(content, domain.ToArray());
}
示例5: DomainWithSingleLabel
public void DomainWithSingleLabel() {
Domain domain = new Domain(Helper.GetArray("www"));
byte[] content = Helper.ReadFixture("Domain", "www-label");
CollectionAssert.AreEqual(content, domain.ToArray());
}
示例6: PointerResourceRecord
public PointerResourceRecord(Domain domain, Domain pointer, TimeSpan ttl = default(TimeSpan))
: base(new ResourceRecord(domain, pointer.ToArray(), RecordType.PTR, RecordClass.IN, ttl))
{
PointerDomainName = pointer;
}
示例7: CanonicalNameResourceRecord
public CanonicalNameResourceRecord(Domain domain, Domain cname, TimeSpan ttl = default(TimeSpan))
: base(new ResourceRecord(domain, cname.ToArray(), RecordType.CNAME, RecordClass.IN, ttl))
{
CanonicalDomainName = cname;
}