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