
Add(MainForm,3532839,56,105)
{
Caption="Пример использования ArrayEnum"
}
Add(Button,9223468,98,105)
{
Left=105
Top=104
Caption="2"
link(onClick,8708597:doWork,[])
}
Add(StrList,16086352,56,35)
{
Strings=#9:10.10.4.1|9:10.10.4.2|9:10.10.4.3|9:10.10.4.4|
}
Add(StrList,16421995,98,35)
{
Strings=#13:255.255.192.0|13:255.255.192.0|13:255.255.192.0|13:255.255.192.0|
}
Add(Message,12373973,182,105)
{
}
Add(StrList,2838620,140,35)
{
Strings=#9:10.10.0.1|
}
Add(VBJScript,8708597,140,105)
{
WorkPoints=#6:doWork|
EventPoints=#7:onData1|
DataPoints=#3:ip1|4:mask|5:gate1|4:dns1|
Script=#24:Sub doWork (Data, Index)|17:Set ip1 = sys.ip1|19:Set mask = sys.mask|21:Set gate1 = sys.gate1|19:Set dns1 = sys.dns1|0:|17:strComputer = "."|112:Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")|115:Set colNetCards = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")|21:'On Error Resume Next|15:Dim METRICArray|22:METRICArray = Array(1)|34:For Each objNetCard in colNetCards|82: intResult = objNetCard.EnableStatic(GetStaticArray(ip1), GetStaticArray(mask))|22:Select case intResult|61:Case 0 : MsgBox "Successful completion, no reboot required"|58:Case 1 : MsgBox "Successful completion, reboot required"|58:Case 64 : MsgBox "Method not supported on this platform"|36:Case 65 : MsgBox "Unknown failure"|40:Case 66 : MsgBox "Invalid subnet mask"|85:Case 67 : MsgBox "An error occurred while processing an Instance that was returned"|44:Case 68 : MsgBox "Invalid input parameter"|51:Case 69 : MsgBox "More than 5 gateways specified"|40:Case 70 : MsgBox "Invalid IP address"|47:Case 71 : MsgBox "Invalid gateway IP address"|97:Case 72 : MsgBox "An error occurred while accessing the Registry for the requested information"|40:Case 73 : MsgBox "Invalid domain name"|38:Case 74 : MsgBox "Invalid host name"|61:Case 75 : MsgBox "No primary/secondary WINS server defined"|33:Case 76 : MsgBox "Invalid file"|40:Case 77 : MsgBox "Invalid system path"|37:Case 78 : MsgBox "File copy failed"|47:Case 79 : MsgBox "Invalid security parameter"|55:Case 80 : MsgBox "Unable to configure TCP/IP service"|53:Case 81 : MsgBox "Unable to configure DHCP service"|47:Case 82 : MsgBox "Unable to renew DHCP lease"|49:Case 83 : MsgBox "Unable to release DHCP lease"|46:Case 84 : MsgBox "IP not enabled on adapter"|47:Case 85 : MsgBox "IPX not enabled on adapter"|54:Case 86 : MsgBox "Frame/network number bounds error"|39:Case 87 : MsgBox "Invalid frame type"|43:Case 88 : MsgBox "Invalid network number"|45:Case 89 : MsgBox "Duplicate network number"|44:Case 90 : MsgBox "Parameter out of bounds"|34:Case 91 : MsgBox "Access denied"|34:Case 92 : MsgBox "Out of memory"|35:Case 93 : MsgBox "Already exists"|51:Case 94 : MsgBox "Path, file or object not found"|45:Case 95 : MsgBox "Unable to notify service"|49:Case 96 : MsgBox "Unable to notify DNS service"|47:Case 97 : MsgBox "Interface not configurable"|66:Case 98 : MsgBox "Not all DHCP leases could be released/renewed"|49:Case 100 : MsgBox "DHCP not enabled on adapter"|11:End Select|76: errGateways = objNetCard.SetGateways(GetStaticArray(gate1), METRICArray)|60: objNetCard.SetDNSServerSearchOrder(GetStaticArray(dns1))|4:Next|15:Sys.onData1 "1"|7:End Sub|0:|32:Function GetStaticArray(sys_arr)|13: Dim arr()|28: ReDim arr(sys_arr.Count)|36: For i = 0 To (sys_arr.Count - 1)|31: arr(i) = sys_arr.Get(i)|8: Next|44: GetStaticArray = Split(RTrim(Join(arr)))|12:End Function|
UseName=0
link(onData1,12373973:doMessage,[])
link(ip1,16086352:Array,[(146,92)(76,92)])
link(mask,16421995:Array,[(153,88)(118,88)])
link(gate1,2838620:Array,[])
link(dns1,15414091:Array,[(167,88)(202,88)])
}
Add(StrList,15414091,182,35)
{
Strings=#7:8.8.8.8|7:8.8.4.4|
}