[求助]winsock控件循环的问题!
刚刚学vb,想写一个自动提交url的小程序,搞了很多天,写出如下的代码,但是不能循环,请教各位了
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim urll, gett, ttt As String
Dim i, j As Long
Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then MsgBox "请完整输入", , "提示"
i = Text3.Text
urll = Text1.Text
gett = Text2.Text
gett = "GET " + gett + " HTTP/1.0"
Winsock1.RemoteHost = CStr(urll)
Winsock1.RemotePort = 80
Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
Winsock1.SendData gett
End Sub
不知道上面的对不对,我用nc监控本地80端口,得到get “/1111/11.asp" http/1.0l类似字样
想问的是:
1、上面的程序可以实现提交url从而实现自动点击某个连接吧?
2,我把循环加入到那里合适呢,
for i=1 to j
Winsock1.RemoteHost = CStr(urll)
Winsock1.RemotePort = 80
Winsock1.Connect
next
我加到这里,结果第一次成功,第二次就不行了,请教各位了!