PortCollection::Item Property (Int32)
.NET Framework (current version)
Gets or sets the value of a Port at the specified zero-based index.
Assembly: System.Web.Services (in System.Web.Services.dll)
public: property Port^ default[ int index ] { Port^ get(int index); void set(int index, Port^ value); }
Parameters
- index
-
Type:
System::Int32
The zero-based index of the Port whose value is modified or returned.
Property Value
Type: System.Web.Services.Description::Port^The value of a port at the specified index.
Service^ myService; PortCollection^ myPortCollection; ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathServiceItem_cs.wsdl" ); Console::WriteLine( "Total number of services : {0}", myServiceDescription->Services->Count ); for ( int i = 0; i < myServiceDescription->Services->Count; ++i ) { myService = myServiceDescription->Services[ i ]; Console::WriteLine( "Name : {0}", myService->Name ); myPortCollection = myService->Ports; // Create an array of ports. Console::WriteLine( "\nPort collection :" ); for ( int i1 = 0; i1 < myService->Ports->Count; ++i1 ) { Console::WriteLine( "Port[{0}] : {1}", i1, myPortCollection[ i1 ]->Name ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: