For Each dcs As DataCol In DataTables("交换机").DataCols For Each drs As DataRow In DataTables("交换机").DataRows Dim str1 As String = drs(dcs) Dim str2 As String = e.Row("主机_有线MAC") Dim b As Boolean = str1.Contains(str2) If b = True Then dr("交换机_IP地址") = drs("交换机_IP地址") dr("交换机_主机名") = drs("交换机_主机名") dr("交换机_端口")=dcs.name Exit For Exit For Else dr("交换机_主机名")=Nothing dr("交换机_IP地址")=Nothing dr("交换机_端口")=Nothing End If Next Next 请问当if b=true成立时 想要退出全部for each循环 如何加代码 用exit for试了几次不能完全退出
|