|
5#
楼主 |
发表于 2006-8-3 11:28:52
|
只看该作者
Dim row,IP(4),Mask(4),dMask(4),dData(4)
JavaWindow("Configuration Management").JavaTree("JTree").Select "#0;Object Manager;Address Objects"
row=JavaWindow("Configuration Management").JavaTable("JXTreeTable").GetROProperty("rows")
row=row-1
'msgbox row
JavaWindow("Configuration Management").JavaTable("JXTreeTable").SelectRow "#"&row&""
JavaWindow("Configuration Management").JavaButton("edit").Click
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("IP:").Set DataTable("IP_1", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit(".").Set DataTable("IP_2", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._2").Set DataTable("IP_3", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._3").Set DataTable("IP_4", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("Netmask:").Set DataTable("Mask_1", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._4").Set DataTable("Mask_2", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._5").Set DataTable("Mask_3", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._6").Set DataTable("Mask_4", dtLocalSheet)
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaButton("ok").Click
'JavaWindow("Configuration Management").JavaDialog("Edit Address:QQQQ").JavaEdit("IP:").Set "11"
JavaWindow("Configuration Management").JavaTable("JXTreeTable").SelectRow "#"&row&""
JavaWindow("Configuration Management").JavaButton("edit").Click
IP(0)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("IP:").GetROProperty("value")
IP(1)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit(".").GetROProperty("value")
IP(2)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._2").GetROProperty("value")
IP(3)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._3").GetROProperty("value")
Mask(0)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("Netmask:").GetROProperty("value")
Mask(1)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._4").GetROProperty("value")
Mask(2)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._5").GetROProperty("value")
Mask(3)=JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaEdit("._6").GetROProperty("value")
JavaWindow("Configuration Management").JavaDialog("Edit Address:address_1").JavaButton("ok").Click
dMask(0)=DataTable("Mask_1", dtLocalSheet)
dMask(1)=DataTable("Mask_2", dtLocalSheet)
dMask(2)=DataTable("Mask_3", dtLocalSheet)
dMask(3)=DataTable("Mask_4", dtLocalSheet)
For i=0 to 3
j=i+1
If dMask(i)=255 Then
dData(i)=DataTable("IP_"&j&"", dtLocalSheet)
' msgbox dData(i)
else dData(i)=0
'msgbox dData(i)
End If
Next
For i=0 to 3
If dData(i) < IP(i) And Mask(i) <dMask(i) Then
result=0
Exit for
elseif dData(i) > IP(i) And Mask(i) >dMask(i) then
result=0
Exit for
else result=1
End If
Next
'msgbox result
If result=0 Then
Reporter.ReportEvent micFail,"edit address", "failed,please check"
else
Reporter.ReportEvent micDone,"edit address", "successfully"
End If
JavaWindow("Configuration Management").JavaTree("JTree").Select "#0;Object Manager;Address Objects"
全部代码如上:
我现在将上面部分改为
For i=0 to 3
If dData(i) < IP(i) And Mask(i) <dMask(i) Then
result=0
Exit for
elseif dData(i) > IP(i) And Mask(i) >dMask(i) then
result=0
Exit for
else result=1
End If
Next
就可以运行成功了 |
|