本文整理汇总了C#中System.DomainName类的典型用法代码示例。如果您正苦于以下问题:C# DomainName类的具体用法?C# DomainName怎么用?C# DomainName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DomainName类属于System命名空间,在下文中一共展示了DomainName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CAARecord
/// <summary>
/// Creates a new instance of the CAARecord class
/// </summary>
/// <param name="name"> Name of the zone </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="flags">The flags</param>
/// <param name="tag">The name of the tag</param>
/// <param name="value">The value of the tag</param>
public CAARecord(DomainName name, int timeToLive, byte flags, string tag, string value)
: base(name, RecordType.CAA, RecordClass.INet, timeToLive)
{
Flags = flags;
Tag = tag;
Value = value;
}
示例2: ParseRecordData
internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
{
Priority = DnsMessageBase.ParseUShort(resultData, ref startPosition);
Weight = DnsMessageBase.ParseUShort(resultData, ref startPosition);
Port = DnsMessageBase.ParseUShort(resultData, ref startPosition);
Target = DnsMessageBase.ParseDomainName(resultData, ref startPosition);
}
示例3: ParseRecordData
internal override void ParseRecordData(DomainName origin, string[] stringRepresentation)
{
if (stringRepresentation.Length != 1)
throw new FormatException();
NameServer = ParseDomainName(origin, stringRepresentation[0]);
}
示例4: ParseRecordData
internal override void ParseRecordData(DomainName origin, string[] stringRepresentation)
{
if (stringRepresentation.Length < 1)
throw new FormatException();
PublicKey = String.Join(String.Empty, stringRepresentation).FromBase64String();
}
示例5: DiffieHellmanKeyRecord
/// <summary>
/// Creates a new instance of the DiffieHellmanKeyRecord class
/// </summary>
/// <param name="name"> Name of the record </param>
/// <param name="recordClass"> Class of the record </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="flags"> Flags of the key </param>
/// <param name="protocol"> Protocol for which the key is used </param>
/// <param name="prime"> Binary data of the prime of the key </param>
/// <param name="generator"> Binary data of the generator of the key </param>
/// <param name="publicValue"> Binary data of the public value </param>
public DiffieHellmanKeyRecord(DomainName name, RecordClass recordClass, int timeToLive, ushort flags, ProtocolType protocol, byte[] prime, byte[] generator, byte[] publicValue)
: base(name, recordClass, timeToLive, flags, protocol, DnsSecAlgorithm.DiffieHellman)
{
Prime = prime ?? new byte[] { };
Generator = generator ?? new byte[] { };
PublicValue = publicValue ?? new byte[] { };
}
示例6: ParseRecordData
internal override void ParseRecordData(DomainName origin, string[] stringRepresentation)
{
if (stringRepresentation.Length == 0)
throw new FormatException();
TextParts = stringRepresentation;
}
示例7: UriRecord
/// <summary>
/// Creates a new instance of the MxRecord class
/// </summary>
/// <param name="name"> Name of the zone </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="priority"> Priority of the record </param>
/// <param name="weight"> Weight of the record </param>
/// <param name="target"> Target of the record </param>
public UriRecord(DomainName name, int timeToLive, ushort priority, ushort weight, string target)
: base(name, RecordType.Uri, RecordClass.INet, timeToLive)
{
Priority = priority;
Weight = weight;
Target = target ?? String.Empty;
}
示例8: DomainName_Unit_Constructor1_FirstLevelIsEmpty
public void DomainName_Unit_Constructor1_FirstLevelIsEmpty()
{
String firstLevelLabel = String.Empty;
String secondLevelLabel = "vizistata";
String subDomainLabel = "www";
DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
}
示例9: WksRecord
/// <summary>
/// Creates a new instance of the WksRecord class
/// </summary>
/// <param name="name"> Name of the host </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="address"> IP address of the host </param>
/// <param name="protocol"> Type of the protocol </param>
/// <param name="ports"> List of ports which are supported by the host </param>
public WksRecord(DomainName name, int timeToLive, IPAddress address, ProtocolType protocol, List<ushort> ports)
: base(name, RecordType.Wks, RecordClass.INet, timeToLive)
{
Address = address ?? IPAddress.None;
Protocol = protocol;
Ports = ports ?? new List<ushort>();
}
示例10: GPosRecord
/// <summary>
/// Creates a new instance of the GPosRecord class
/// </summary>
/// <param name="name"> Name of the record </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="longitude"> Longitude of the geographical position </param>
/// <param name="latitude"> Latitude of the geographical position </param>
/// <param name="altitude"> Altitude of the geographical position </param>
public GPosRecord(DomainName name, int timeToLive, double longitude, double latitude, double altitude)
: base(name, RecordType.GPos, RecordClass.INet, timeToLive)
{
Longitude = longitude;
Latitude = latitude;
Altitude = altitude;
}
示例11: ParseRecordData
internal override void ParseRecordData(DomainName origin, string[] stringRepresentation)
{
if (stringRepresentation.Length != 1)
throw new FormatException();
X25Address = stringRepresentation[0];
}
示例12: PxRecord
/// <summary>
/// Creates a new instance of the PxRecord class
/// </summary>
/// <param name="name"> Name of the record </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="preference"> Preference of the record </param>
/// <param name="map822"> Domain name containing the RFC822 domain </param>
/// <param name="mapX400"> Domain name containing the X.400 part </param>
public PxRecord(DomainName name, int timeToLive, ushort preference, DomainName map822, DomainName mapX400)
: base(name, RecordType.Px, RecordClass.INet, timeToLive)
{
Preference = preference;
Map822 = map822 ?? DomainName.Root;
MapX400 = mapX400 ?? DomainName.Root;
}
示例13: HipRecord
/// <summary>
/// Creates a new instace of the HipRecord class
/// </summary>
/// <param name="name"> Name of the record </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="algorithm"> Algorithm of the key </param>
/// <param name="hit"> Host identity tag </param>
/// <param name="publicKey"> Binary data of the public key </param>
/// <param name="rendezvousServers"> Possible rendezvous servers </param>
public HipRecord(DomainName name, int timeToLive, IpSecKeyRecord.IpSecAlgorithm algorithm, byte[] hit, byte[] publicKey, List<DomainName> rendezvousServers)
: base(name, RecordType.Hip, RecordClass.INet, timeToLive)
{
Algorithm = algorithm;
Hit = hit ?? new byte[] { };
PublicKey = publicKey ?? new byte[] { };
RendezvousServers = rendezvousServers ?? new List<DomainName>();
}
示例14: ParseRecordData
internal override void ParseRecordData(DomainName origin, string[] stringRepresentation)
{
if (stringRepresentation.Length != 2)
throw new FormatException();
Cpu = stringRepresentation[0];
OperatingSystem = stringRepresentation[1];
}
示例15: CDsRecord
/// <summary>
/// Creates a new instance of the CDsRecord class
/// </summary>
/// <param name="name"> Name of the record </param>
/// <param name="recordClass"> Class of the record </param>
/// <param name="timeToLive"> Seconds the record should be cached at most </param>
/// <param name="keyTag"> Key tag </param>
/// <param name="algorithm"> Algorithm used </param>
/// <param name="digestType"> Type of the digest </param>
/// <param name="digest"> Binary data of the digest </param>
public CDsRecord(DomainName name, RecordClass recordClass, int timeToLive, ushort keyTag, DnsSecAlgorithm algorithm, DnsSecDigestType digestType, byte[] digest)
: base(name, RecordType.Ds, recordClass, timeToLive)
{
KeyTag = keyTag;
Algorithm = algorithm;
DigestType = digestType;
Digest = digest ?? new byte[] { };
}