| | |
VB.net search ArrayList
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
How do you guys recommend searching an ArrayList for a specific string? My arraylist is defined as:
What I'm trying to compare is the IP string from the switch structure and the DIST_IP string from the neighbor structure. Problem is, using VisioSwitchArray.contains(some_ip_address) always returns false. I'm guessing it is searching for a matching switch object with in the list right?
vb Syntax (Toggle Plain Text)
Public Shared VisioSwitchArray As New ArrayList() Public Structure switch Public HOSTNAME As String Public IP As String Public MODEL As String Public VLANS As String Public NEIs() As neighbor End Structure Public Structure neighbor Public IFACE As String Public DIST_IP As String Public DIST_IFACE As String End Structure
What I'm trying to compare is the IP string from the switch structure and the DIST_IP string from the neighbor structure. Problem is, using VisioSwitchArray.contains(some_ip_address) always returns false. I'm guessing it is searching for a matching switch object with in the list right?
Rivera
•
•
•
•
I'm guessing it is searching for a matching switch object with in the list right?
You can't use Contains method in this case. You have to loop and cast to find the right value
VB.NET Syntax (Toggle Plain Text)
Dim i As Integer For i = 0 To VisioSwitchArray.Count - 1 If CType(VisioSwitchArray.Item(i), switch).IP = "10.0.0.2" Then ' Found Exit For End If Next i
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Binary search arraylist (Java)
- Search in vb.net (VB.NET)
- Search Assistant problem won't go away (Viruses, Spyware and other Nasties)
- Review for Search Studio Inc - Web Design (Website Reviews)
- Finding the object in an ArrayList (C++)
- unwanted search bars... (Viruses, Spyware and other Nasties)
- home search asistent log!!! (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: TabPage Image + DrawItem
- Next Thread: Which HTML Element is clicked in WEBBROWSER CONTROL
| Thread Tools | Search this Thread |
.net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images insert intel internet listview login mobile monitor ms net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial soap sql string table tcp text textbox timer toolbox trim update updown upload user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





