VB webbroser1逐行读取txt打开网站后怎么逐个把RichTextBox1、2、3中的信息提交到网页上?请高手帮修改一下?在这感谢各位高手!
本帖最后由 nikuku 于 2011-09-11 15:02:50 编辑
'VB webbroser1逐行读取\vb.txt打开网站
'***********VB 延时函数定义*************************************
'声明
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
'延时
Public Sub Delay(ByVal num As Integer)
Dim t As Long
t = timeGetTime
Do Until timeGetTime - t >= num * 1000
DoEvents
Loop
End Sub
'***************************************************************
'将字符串写入文件,这个函数没用到,不过可能对你会有用
Private Sub WriteFile(filePath As String, strTmp As String)
Open filePath For Output As #1
Print #1, strTmp
Close #1
End Sub
'***************************************************************
'读文件返回字符串
Private Function ReadFile(filePath As String) As String
Dim fileStr As String
Open filePath For Input As #1
Do While Not EOF(1)
Line Input #1, tem
fileStr = fileStr & tem & vbCrLf
Loop
Close #1
ReadFile = fileStr
End Function
'***************************************************************
'执行程序
Private Sub Command1_Click()
Dim url() As String
url = Split(ReadFile(App.Path & "\vb.txt"), vbCrLf)
For i = 0 To UBound(url) - 1
WebBrowser1.Navigate "about:blank"
WebBrowser1.Navigate url(i)
Delay (5)
Next
MsgBox "完毕"
End Sub
'***************************************************************
'然后怎么把RichTextBox1、2、3信息怎么逐个提交到网页上?
Private Sub Command1_Click()
WebBrowser1.Document.getElementById("feedback-fullname").Value = RichTextBox1.Text
WebBrowser1.Document.getElementById("feedback-email-address").Value = RichTextBox2.Text
WebBrowser1.Document.getElementById("feedback-suggest").Value = RichTextBox3.Text
WebBrowser1.Document.getElementById("feedback-submit").Click
End Sub
'请高手帮修改一下,谢谢!
[解决办法]
木有人?
[解决办法]
该回复于2011-09-14 14:25:19被版主删除