PortCollection.Remove メソッド
アセンブリ: System.Web.Services (system.web.services.dll 内)



Dim myService As Service Dim myPortCollection As PortCollection Dim myServiceDescription As ServiceDescription = _ ServiceDescription.Read("MathServiceItem_vb.wsdl") Console.WriteLine("Total number of services : " & _ myServiceDescription.Services.Count.ToString) Dim i As Integer For i = 0 to myServiceDescription.Services.Count - 1 myService = myServiceDescription.Services(i) Console.WriteLine("Name : " & myService.Name) myPortCollection = myService.Ports ' Create an array of ports. Console.WriteLine(ControlChars.NewLine & "Port collection :") Dim i1 As Integer For i1 = 0 to myService.Ports.Count - 1 Console.WriteLine("Port[" & i1.ToString & "] : " & _ myPortCollection(i1).Name) Next Dim strPort As String = myPortCollection(0).Name Dim myPort As Port = myPortCollection(strPort) Console.WriteLine(ControlChars.NewLine & _ "Index of Port[" & strPort & "] : " & _ myPortCollection.IndexOf(myPort).ToString) Dim myPortTestRemove As Port = myPortCollection(0) Console.WriteLine(ControlChars.NewLine & _ "Total number of ports before removing " & _ "a port '" & myPortTestRemove.Name & "' is : " & _ myService.Ports.Count.ToString) myPortCollection.Remove(myPortTestRemove) Console.WriteLine("Total number of ports after removing " & _ "a port '" & myPortTestRemove.Name & "' is : " & _ myService.Ports.Count.ToString) ' Create the WSDL file. myPortCollection.Insert(0, myPortTestRemove) myServiceDescription.Write("MathServiceItemNew_vb.wsdl") Next
Service myService; PortCollection myPortCollection; ServiceDescription myServiceDescription = ServiceDescription.Read("MathServiceItem_cs.wsdl"); Console.WriteLine("Total number of services : " + myServiceDescription.Services.Count); for(int i=0; i < myServiceDescription.Services.Count; ++i) { myService = myServiceDescription.Services[i]; Console.WriteLine("Name : " + 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[" + i1+"] : " + myPortCollection[i1].Name); } string strPort = myPortCollection[0].Name; Port myPort = myPortCollection[strPort]; Console.WriteLine("\nIndex of Port[" + strPort + "] : " + myPortCollection.IndexOf(myPort)); Port myPortTestRemove = myPortCollection[0]; Console.WriteLine("\nTotal number of ports before removing " + "a port '" + myPortTestRemove.Name +"' is : " + myService.Ports.Count); myPortCollection.Remove(myPortTestRemove); Console.WriteLine("Total number of ports after removing " + "a port '" + myPortTestRemove.Name +"' is : " + myService.Ports.Count); // Create the WSDL file. myPortCollection.Insert(0, myPortTestRemove); myServiceDescription.Write("MathServiceItemNew_cs.wsdl");
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 ); } String^ strPort = myPortCollection[ 0 ]->Name; Port^ myPort = myPortCollection[ strPort ]; Console::WriteLine( "\nIndex of Port[{0}] : {1}", strPort, myPortCollection->IndexOf( myPort ) ); Port^ myPortTestRemove = myPortCollection[ 0 ]; Console::WriteLine( "\nTotal number of ports before removing a port '{0}' is : {1}", myPortTestRemove->Name, myService->Ports->Count ); myPortCollection->Remove( myPortTestRemove ); Console::WriteLine( "Total number of ports after removing a port '{0}' is : {1}", myPortTestRemove->Name, myService->Ports->Count ); // Create the WSDL file. myPortCollection->Insert( 0, myPortTestRemove ); myServiceDescription->Write( "MathServiceItemNew_cs.wsdl" );
Service myService; PortCollection myPortCollection; ServiceDescription myServiceDescription = ServiceDescription.Read("MathServiceItem_jsl.wsdl"); Console.WriteLine("Total number of services : " + myServiceDescription.get_Services().get_Count()); for (int i = 0; i < myServiceDescription.get_Services(). get_Count(); ++i) { myService = myServiceDescription.get_Services().get_Item(i); Console.WriteLine("Name : " + myService.get_Name()); myPortCollection = myService.get_Ports(); // Create an array of ports. Console.WriteLine("\nPort collection :"); for (int i1 = 0; i1 < myService.get_Ports().get_Count(); ++i1) { Console.WriteLine("Port[" + i1 + "] : " + myPortCollection.get_Item(i1).get_Name()); } String strPort = myPortCollection.get_Item(0).get_Name(); Port myPort = myPortCollection.get_Item(strPort); Console.WriteLine("\nIndex of Port[" + strPort + "] : " + myPortCollection.IndexOf(myPort)); Port myPortTestRemove = myPortCollection.get_Item(0); Console.WriteLine("\nTotal number of ports before removing " + "a port '" + myPortTestRemove.get_Name() + "' is : " + myService.get_Ports().get_Count()); myPortCollection.Remove(myPortTestRemove); Console.WriteLine("Total number of ports after removing " + "a port '" + myPortTestRemove.get_Name() + "' is : " + myService.get_Ports().get_Count()); // Create the WSDL file. myPortCollection.Insert(0, myPortTestRemove); myServiceDescription.Write("MathServiceItemNew_jsl.wsdl");

Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPortCollection.Remove メソッドを検索する場合は、下記のリンクをクリックしてください。

- PortCollection.Remove メソッドのページへのリンク