This documentation is archived and is not being maintained.

IPAddress.None Field

Provides an IP address indicating that no network interface should be used. This field is read-only.

[Visual Basic]
Public Shared ReadOnly None As IPAddress
[C#]
public static readonly IPAddress None;
[C++]
public: static IPAddress* None;
[JScript]
public static var None : IPAddress;

Remarks

The Socket.Bind method uses the None field to indicate that a Socket should not listen for client activity. The None field is equivalent to 255.255.255.255 in dotted-quad notation.

Example

[Visual Basic, C#, C++] The following example uses the None property to indicate that no network interface should be used.

[Visual Basic] 
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 'Main 

[C#] 
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);
}

[C++] 
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(S"IP address : {0}", address);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IPAddress Class | IPAddress Members | System.Net Namespace

Show: