IPInterfaceProperties.IsDynamicDnsEnabled 属性

定义

获取 Boolean 值,该值指示此接口是否配置为自动向域名系统 (DNS) 注册其 IP 地址信息。

public:
 abstract property bool IsDynamicDnsEnabled { bool get(); };
public abstract bool IsDynamicDnsEnabled { get; }
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public abstract bool IsDynamicDnsEnabled { get; }
member this.IsDynamicDnsEnabled : bool
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.IsDynamicDnsEnabled : bool
Public MustOverride ReadOnly Property IsDynamicDnsEnabled As Boolean

属性值

如果此接口被配置为自动注册其动态 IP 地址与静态域名之间的映射,则为 true;否则为 false

属性

示例

下面的代码示例显示此属性的值。

void DisplayDnsConfiguration()
{
   array<NetworkInterface^>^adapters = NetworkInterface::GetAllNetworkInterfaces();
   System::Collections::IEnumerator^ myEnum10 = adapters->GetEnumerator();
   while ( myEnum10->MoveNext() )
   {
      NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum10->Current);
      IPInterfaceProperties ^ properties = adapter->GetIPProperties();
      Console::WriteLine( adapter->Description );
      Console::WriteLine( "  DNS suffix................................. :{0}", 
         properties->DnsSuffix );
      Console::WriteLine( "  DNS enabled ............................. : {0}", 
         properties->IsDnsEnabled );
      Console::WriteLine( "  Dynamically configured DNS .............. : {0}", 
         properties->IsDynamicDnsEnabled );
   }
}
public static void DisplayDnsConfiguration()
{
    NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties properties = adapter.GetIPProperties();
        Console.WriteLine(adapter.Description);
        Console.WriteLine("  DNS suffix .............................. : {0}",
            properties.DnsSuffix);
        Console.WriteLine("  DNS enabled ............................. : {0}",
            properties.IsDnsEnabled);
        Console.WriteLine("  Dynamically configured DNS .............. : {0}",
            properties.IsDynamicDnsEnabled);
    }
    Console.WriteLine();
}
Public Shared Sub DisplayDnsConfiguration() 
    Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim adapter As NetworkInterface
    For Each adapter In  adapters
        Dim properties As IPInterfaceProperties = adapter.GetIPProperties()
        Console.WriteLine(adapter.Description)
        Console.WriteLine("  DNS suffix................................. :{0}", properties.DnsSuffix)
        Console.WriteLine("  DNS enabled ............................. : {0}", properties.IsDnsEnabled)
        Console.WriteLine("  Dynamically configured DNS .............. : {0}", properties.IsDynamicDnsEnabled)
    Next adapter

End Sub

注解

动态 DNS 使客户端能够通知 DNS 服务器其动态 IP 地址已映射到其静态主机名。

适用于