PhysicalAddress.None 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个具有零长度地址的新 PhysicalAddress 实例。 此字段为只读。
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
字段值
示例
下面的代码示例演示如何使用此字段来测试分析地址的结果。
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;
}