Dim tb1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim mypath As String = tb1.Text
'------------导入订单主表信息------------------提取文件名的内容填入数据. 测试可行!
Dim t As Table = Tables("订单总表")
t.StopRedraw
For Each File As String In FileSys.GetFiles(mypath)
Dim dr As Row =t.AddNew()
dr("备注")= File.Replace(file.SubString(file.LastIndexOf("\"),32),("_K" & file.SubString(file.LastIndexOf("\"),28) & "_K.PDF"))
dr("货号") =file.SubString(file.IndexOf("_")+8,2)
dr("订单号") =file.SubString(file.LastIndexOf("_")+1,10)
dr("订单下载日期")= Date.Today()
'------------导入订单明细表信息------------------提取文件内部内容填入数据 测试不行!
Dim strs As String = FileSys.ReadAllText(file)
strs = strs.Replace(vblf, "")
Dim rs() As String = strs.Split(vbcr)
For i As Integer = 0 To rs.Length - 1
Dim cs() As String = rs(i).Split(New Char() {" "c}, System.StringSplitOptions.RemoveEmptyEntries)
For n As Integer = 0 To cs.length - 1
messagebox.show( n & ":" & cs(n))
Next
exit for
Next
Next
t.ResumeRedraw()