共用方式為


PhysicalAddress.None 欄位

定義

傳回新的 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;
}

備註

如果您指定null位址,方法ParseNone傳回 。

適用於