Dim str As String = "库房|80A|工单号|100|产品编号|70|产品名称|232" Dim ary() As String = str.Split("|") If ary.Length Mod 2 = 1 Then msgbox("格式错误") Else For i As Integer = 0 To ary.length-1 If i Mod 2 = 1 Then Dim d As Integer If Integer.TryParse(ary(i), d) = False Then msgbox("格式错误:" & ary(i)) Exit For End If Else '对列名判断 End If Next End If