Visual Basic - Problema vbscript

Life is soft - evento anual de software empresarial
 
Vista:

Problema vbscript

Publicado por yabrooo (2 intervenciones) el 05/05/2005 17:46:28
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>
<body>
<form>
IP: <input type="text" name="ip"><br>
Mascara: <input type="text" name="mask"><br>
Gateway: <input type="text" name="gate"><br>
<input type="submit" value="Modifica" onclick="red(ip.value,mask.value,gate.value)">
</form>
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder