我有以下代码:
'get the items from listbox4
For Each aa As String In ListBox4.Items
'convert string to uri and grap the hostname for each item in listbox4
Dim myuri As New Uri(aa)
Dim baseUri As String = myuri.GetLeftPart(UriPartial.Authority)
' check if the hostname exist on items of listbox2 and skip the duplicate
If ListBox2.Items.Contains(baseUri) Then
Return
Else
ListBox2.Items.Add(aa)
End If
Next
如何根据第一个 ListBox 中的数据使第二个 ListBox 包含不同的值?