IPAddress.None 欄位

定義

提供 IP 位址,表示不可使用網路介面。 此欄位為唯讀。

public: static initonly System::Net::IPAddress ^ None;
public static readonly System.Net.IPAddress None;
 staticval mutable None : System.Net.IPAddress
Public Shared ReadOnly None As IPAddress 

欄位值

範例

下列範例會 None 使用 屬性來指出不應該使用任何網路介面。

int main()
{
   
   // Gets the IP address indicating that no network interface should be used
   // and converts it to a String*.
   String^ address = IPAddress::None->ToString();
   Console::WriteLine( "IP address : {0}", address );
}
public static void Main()
{
   // Gets the IP address indicating that no network interface should be used
   // and converts it to a string.
   string address = IPAddress.None.ToString();
   Console.WriteLine("IP address : " + address);
}
Public Shared Sub Main()

    ' Gets the IP address indicating that no network interface should be used
    ' and converts it to a string. 
    Dim address As String = IPAddress.None.ToString()
    Console.WriteLine(("IP address : " + address))
End Sub

備註

方法 Socket.BindNone 使用欄位來 Socket 表示 不得接聽客戶端活動。 欄位 None 相當於虛線四邊形表示法中的 255.255.255.255。

適用於