帮我看看这段自动填入网页输入框的代码,很短的,给我做个注释。谢谢!
Case "http://www.szchehang.com/tc/bmfw.htm " ' 当进入主页面时执行以下程序
For i = 0 To WebBrowser1.Document.Forms(Form_ID).length - 1
' 找到代码输入框后填入个股代码
If WebBrowser1.Document.Forms(Form_ID)(i).Name = "code " Then _
WebBrowser1.Document.Forms(Form_ID)(i).Value = Code(Current)
' 在下拉式列表中进行选择
If WebBrowser1.Document.Forms(Form_ID)(i).Name = "target " Then
For k = 0 To WebBrowser1.Document.Forms(Form_ID)(i).length - 1
If WebBrowser1.Document.Forms(Form_ID)(i).Options(k).Text
= "个股资料 " Then
请问length-1是什么意思,帮我解释一下整段代码啊。谢谢
[解决办法]
For i = 0 To WebBrowser1.Document.Forms(Form_ID).length - 1
' 循环表单中全部的控件对象
If WebBrowser1.Document.Forms(Form_ID)(i).Name = "code " Then _
WebBrowser1.Document.Forms(Form_ID)(i).Value = Code(Current)
' 在下拉式列表中进行选择
If WebBrowser1.Document.Forms(Form_ID)(i).Name = "target " Then
For k = 0 To WebBrowser1.Document.Forms(Form_ID)(i).length - 1
If WebBrowser1.Document.Forms(Form_ID)(i).Options(k).Text
= "个股资料 " Then