Foxtable(狐表)用户栏目专家坐堂 → 求把数据导入web的web 的WebBrowser的input中,谢谢


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

主题:求把数据导入web的web 的WebBrowser的input中,谢谢

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/18 1:03:00 [显示全部帖子]

Dim dlg As new OpenFileDialog
dlg.Filter = "文本文件|*.txt"
If dlg.ShowDialog = DialogResult.OK Then
    Dim strs As String = FileSys.ReadAllText(dlg.FileName,encoding.default)
    strs = strs.Replace(" ","")
    strs = strs.Replace(vbcrlf ,",")
    Dim Values() As String
    Values = strs.split(",")
    Dim web = e.Form.Controls("WebBrowser1").BaseControl
    For Index As Integer = 0 To Values.Length - 1
        Dim ary() As String = values(index).split("=")
        web.document.getElementById("A" & Index+1).setattribute("value", ary(0))
        web.document.getElementById("B" & Index+1).setattribute("value", ary(1))
    Next
End If

 回到顶部