Bagikan melalui


PhysicalAddress.None Bidang

Definisi

Mengembalikan instans baru PhysicalAddress dengan alamat panjang nol. Bidang ini hanya-baca.

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 

Nilai Bidang

Contoh

Contoh kode berikut menunjukkan penggunaan bidang ini untuk menguji hasil penguraian alamat.

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;
}

Keterangan

Metode Parse mengembalikan None jika Anda menentukan null alamat.

Berlaku untuk