IPInterfaceProperties.IsDnsEnabled 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个 Boolean 值,该值指示是否将 NetBt 配置为对此接口使用 DNS 名称解析。
public:
abstract property bool IsDnsEnabled { bool get(); };
public abstract bool IsDnsEnabled { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("freebsd")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("osx")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public abstract bool IsDnsEnabled { get; }
member this.IsDnsEnabled : bool
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("freebsd")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("osx")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
member this.IsDnsEnabled : bool
Public MustOverride ReadOnly Property IsDnsEnabled As Boolean
属性值
如果将 NetBt 配置为对此接口使用 DNS 名称解析,则为 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 是用于将主机名映射到 IP 地址的分层命名系统。