以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 求把数据导入web的web 的WebBrowser的input中,谢谢 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=100762) |
||||
-- 作者:limit_1982 -- 发布时间:2017/5/17 22:46:00 -- 求把数据导入web的web 的WebBrowser的input中,谢谢 谢谢
|
||||
-- 作者:有点色 -- 发布时间: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 |