当前位置: 首页>>代码示例>>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;未经允许,请勿转载。