Forum Discussion
Photo_G_84660
Nimbostratus
Dec 28, 2006CommonIPPortDefinition example
Hi,
Does anyone have a Visual Basic .NET example of using Pool.CommonIPPortDefinition() to extract the address and port of pool members into variables? I have been reviewing the C examples on the site, but I really need to see it in VB, if possible.
Thanks in advance,
Scott H.
- Photo_G_84660
Nimbostratus
Ok, I've hammered together this VB code, which seems to do the job. I'm not sure it's as elegant as it can be (so I'm open to suggestions), but if you feed it a pool name, it will grab the members and stick them in a ListBox.Public Sub populateNodeList(ByVal pool As String()) If lbxNode.Items.Count = 0 Then Dim node = New VirtualCurConnCounter.Pool.CommonIPPortDefinition() Dim member_list() = V9Pool.get_member(pool) node = member_list Dim i As Integer For i = 0 To UBound(node(0)) Dim addr = (node(0)(i).address.ToString) Dim port = (node(0)(i).port.ToString) lbxNode.Items.Add(addr + ":" + port) Next i Else lbxNode.Items.Clear() Dim index As Integer = lbxPool.SelectedIndex Dim pool_name As String = lbxPool.Items(index).ToString populateNodeList(New String() {pool_name}) End If End Sub
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects