你知道你为什么招人讨厌吗?因为即便人家帮你写好了,你也不会用,白费别人的力气。
代码写到datacolchanged事件
Select Case e.DataCol.Name
Case "订单详解"
If e.NewValue <> Nothing Then
Dim Info As String = e.NewValue.replace(chr(10) & " ", "")
Dim reg As new System.Text.RegularExpressions.Regex("(?<=.+:{1} {1}).+")
Dim mc As object = reg.Matches(info)
If mc.count = 6 Then
e.DataRow("姓名") = mc(0).Value
e.DataRow("地址") = mc(1).Value
e.DataRow("邮编") = mc(2).Value
e.DataRow("固定电话") = mc(3).Value
e.DataRow("移动电话") = mc(4).Value
e.DataRow("订单编号") = mc(5).Value
End If
End If
End Select
[此贴子已经被作者于2014-6-6 14:22:19编辑过]