PortCollection.Contains Method
.NET Framework 3.0
Returns a value indicating whether the specified Port is a member of the PortCollection.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public boolean Contains ( Port port )
public function Contains ( port : Port ) : boolean
Not applicable.
Parameters
- port
The Port for which to check collection membership.
Return Value
true if the specified Port is a member of the PortCollection; otherwise, false.myPortCollection = myService->Ports; Port^ myNewPort = myPortCollection[ 0 ]; myPortCollection->Remove( myNewPort ); // Display the number of ports. Console::WriteLine( "\nTotal number of ports before adding a new port : {0}", myService->Ports->Count ); // Add a new port. myPortCollection->Add( myNewPort ); // Display the number of ports after adding a port. Console::WriteLine( "Total number of ports after adding a new port : {0}", myService->Ports->Count );
myPortCollection = myService.get_Ports();
Port myNewPort = myPortCollection.get_Item(0);
myPortCollection.Remove(myNewPort);
// Display the number of ports.
Console.WriteLine("\nTotal number of ports before"
+ " adding a new port : "
+ myService.get_Ports().get_Count());
// Add a new port.
myPortCollection.Add(myNewPort);
// Display the number of ports after adding a port.
Console.WriteLine("Total number of ports after"
+ " adding a new port : "
+ myService.get_Ports().get_Count());
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: