當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET PortCollection.Remove方法代碼示例

本文整理匯總了VB.NET中System.Web.Services.Description.PortCollection.Remove方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET PortCollection.Remove方法的具體用法?VB.NET PortCollection.Remove怎麽用?VB.NET PortCollection.Remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.Services.Description.PortCollection的用法示例。


在下文中一共展示了PortCollection.Remove方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。

示例1: myPortCollection

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
開發者ID:VB.NET開發者,項目名稱:System.Web.Services.Description,代碼行數:44,代碼來源:PortCollection.Remove


注:本文中的System.Web.Services.Description.PortCollection.Remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。