PhysicalAddress.None 字段
定义
返回一个具有零长度地址的新 PhysicalAddress 实例。Returns a new PhysicalAddress instance with a zero length address. 此字段为只读。This field is read-only.
public: static initonly System::Net::NetworkInformation::PhysicalAddress ^ None;
public static readonly System.Net.NetworkInformation.PhysicalAddress None;
staticval mutable None : System.Net.NetworkInformation.PhysicalAddress
Public Shared ReadOnly None As PhysicalAddress
字段值
示例
下面的代码示例演示如何使用此字段来测试地址分析的结果。The following code example demonstrates using this field to test the result of parsing an address.
PhysicalAddress^ StrictParseAddress( String^ address )
{
PhysicalAddress^ newAddress = PhysicalAddress::Parse( address );
if ( PhysicalAddress::None->Equals( newAddress ) )
return nullptr;
return newAddress;
}
public static PhysicalAddress StrictParseAddress(string address)
{
PhysicalAddress newAddress = PhysicalAddress.Parse(address);
if (PhysicalAddress.None.Equals(newAddress))
return null;
return newAddress;
}
注解
Parse如果指定 address,则该方法返回 None null 。The Parse method returns None if you specify null address.