Foxtable(狐表)用户栏目专家坐堂 → [求助]文件信息取错误!


  共有2848人关注过本帖树形打印复制链接

主题:[求助]文件信息取错误!

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/5/21 14:41:00 [显示全部帖子]

代码这样写,路径你改一下

 

Dim web As New System.Windows.Forms.WebBrowser()
web.Navigate(ProjectPath &  "工作量.htm")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop


'取数据
Dim Cols() As String = { "病区名称","入院人数","转入人数","转出人数","出院人数","实际病床日","手术床日" }

Dim elems As object = web.Document.GetElementsByTagName("table")(1).GetElementsByTagName("tr")

Dim m As Integer = 0
If elems.count > 1 Then
    For j As Integer = 1 To elems.count - 1
        Dim tdelems As object = elems(j).GetElementsByTagName("td")
        Dim nr As Row = Tables("长江现货").AddNew
        For i As Integer = 0 To tdelems.count - 1
            nr(Cols(i)) = tdelems(i).Innertext
        Next
    Next
End If

Tables("长江现货").save


 回到顶部