Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/05/2005, 09:53
Esqualli
 
Fecha de Ingreso: mayo-2005
Mensajes: 4
Antigüedad: 18 años, 11 meses
Puntos: 0
Problema vbscript

Wenas!
Tengo un pequeño problema con el codigo que adjunto, en teoria deberia pasar las variables que se le introduzcan en el formulario al script de vb, pero no lo hace, a ver si alguien me puede decir el porque...tal y como esta ahora me da el error: "No se puede utilizar parentesis al llamar a sub"
Muchas gracias

<html>
<head>
<script language="vbscript">
sub red(ip,mask,gate)
//dim ip
//dim mask
//dim gate

strComputer = "."
Set objWMIService = GetObject( "winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery ("Select * from Win32_NetworkAdapterConfiguration " & "where IPEnabled=TRUE")
strIPAddress = Array(ip)
strSubnetMask = Array(mask)
strGateway = Array(gate)
strGatewayMetric = Array(1)

For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
Next
end sub
</script>
</head>
&ltbody>
&ltform>
IP: &ltinput type="text" name="ip">&ltbr>
Mascara: &ltinput type="text" name="mask">&ltbr>
Gateway: &ltinput type="text" name="gate">&ltbr>
&ltinput type="submit" value="Modifica" onclick="red(ip.value,mask.value,gate.value)">
</form>
</body>
</html>