1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
| <html>
<HTA:APPLICATION
APPLICATIONNAME="Set IP config"
SCROLL="no"
SINGLEINSTANCE="yes"
ICON="nslookup.exe"
MAXIMIZEBUTTON="no"
WINDOWSTATE="no">
<style type='text/css'>
input {width:21px;
border:0px;
font-size:10px;
background-color:lightcyan;
font-weight:bold;
text-align:center;
}
BODY {background:lightcyan;}
.button {
border-size: 0px;
border-style: none;
background: inherit;
width: 120px;
font-size:14px;
color: blue;
cursor: hand;
cursor: pointer;
padding: 0px;
}
</style>
</head>
<title>Saisie des adresses IP</title>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<script language="VBScript">
Dim IP
Dim Masque
Dim Passerelle
Dim DNS1
Dim DNS2
IP = N1.Value &"."& N2.Value &"."& N3.Value &"."& N4.Value
Masque = N5.Value &"."& N6.Value &"."& N7.Value &"."& N8.Value
Passerelle = N9.Value &"."& N10.Value &"."& N11.Value &"."& N12.Value
DNS1 = N13.Value &"."& N14.Value &"."& N15.Value &"."& N16.Value
DNS2 = N17.Value &"."& N18.Value &"."& N19.Value &"."& N20.Value
Sub Window_OnLoad
CenterWindow 320,350
End Sub
Sub CenterWindow(x,y)
window.resizeTo x, y
iLeft = window.screen.availWidth/2 - x/2
itop = window.screen.availHeight/2 - y/2
window.moveTo ileft, itop
End Sub
Function IP_Valide(ip)
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "\b((25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(25[0-5]|2[0-4]\d|1?\d?\d)\b"
.IgnoreCase = False
If .Test(ip)= True then
IP_Valide = True
end if
End With
End Function
Sub CheckIP()
If Not IP_Valide(IP) Then
MsgBox IP
MsgBox "L'adresse IP que vous avez saisi "&IP&vbcr&" est non valide",16,"L'adresse IP que vous avez saisi est non valide"
N1.Focus()
End If
If Not IP_Valide(Masque) Then
MsgBox "L'adresse IP du masque sous-réseau que vous avez saisi est non valide",16,"L'adresse IP du masque sous-réseau que vous avez saisi est non valide"
MsgBox Masque
N2.Focus()
End If
If Not IP_Valide(Passerelle) Then
MsgBox "L'adresse IP de la Passerelle par défaut que vous avez saisi est non valide",16,"L'adresse IP de la Passerelle par défaut que vous avez saisi est non valide"
N3.Focus()
End If
If Not IP_Valide(DNS1) Then
MsgBox "L'adresse IP de DNS1 que vous avez saisi est non valide",16,"L'adresse IP de DNS1 que vous avez saisi est non valide"
N4.Focus()
End If
If Not IP_Valide(DNS2) Then
MsgBox "L'adresse IP de DNS2 que vous avez saisi est non valide",16,"L'adresse IP de DNS2 que vous avez saisi est non valide"
N5.Focus()
End If
If IP_Valide(IP) And IP_Valide(Masque) And IP_Valide(Passerelle) And IP_Valide(DNS1) And IP_Valide(DNS2) Then
MsgBox "IP : "&IP&vbCr&"Masque sous réseau : "&Masque&vbCr&"Passerelle par défaut : "&Passerelle&vbCr&_
"DNS1 : "& DNS1&vbCr&"DNS2 : "& DNS2,64,"Les @ IP"
End If
End Sub
</script>
<body>
<fieldset>
<legend>Utiliser l'adresse IP suivante</legend>
<table>
<tr>
<td><p style="float:left"><B>Adresse IP Locale :</B></p></td>
<td><div style="border:solid 1px gray;width:100px;"><input type='text' class="IP" maxLength="3" name="N1" /><b>.</b><input type='text' class="IP" maxLength="3" name="N2"/><b>.</b><input type='text' class="IP" maxLength="3" name="N3"/><b>.</b><input type='text' class="IP" maxLength="3" name="N4" />
</div></td>
</tr>
<tr>
<td><p style="float:left"><B>Masque sous-réseau :</B></p></td>
<td><div style="border:solid 1px gray;width:100px;"><input type='text' class="IP" maxLength="3" name="N5" /><b>.</b><input type='text' class="IP" maxLength="3" name="N6" /><b>.</b><input type='text' class="IP" maxLength="3" name="N7"/><b>.</b><input type='text' class="IP" maxLength="3" name="N8" />
</div></td>
</tr>
<tr>
<td><p style="float:left"><B>Passerelle par défaut :</B></p></td>
<td><div style="border:solid 1px gray;width:100px;"><input type='text' class="IP" maxLength="3" name="N9" /><b>.</b><input type='text' class="IP" maxLength="3" name="N10"/><b>.</b><input type='text' class="IP" maxLength="3" name="N11" /><b>.</b><input type='text' class="IP" maxLength="3" name="N12" />
</div></td>
</tr>
</table>
</fieldset>
<br>
<fieldset>
<legend>Utiliser l'adresse DNS suivante </legend>
<table>
<tr>
<td><p style="float:left"><B>Serveur DNS N° 1 : </B></p></td>
<td><div style="border:solid 1px gray;width:100px;"><input type='text' class="IP" maxLength="3" name="N13" /><b>.</b><input type='text' class="IP" maxLength="3" name="N14" /><b>.</b><input type='text' class="IP" maxLength="3" name="N15" /><b>.</b><input type='text' class="IP" maxLength="3" name="N16" />
</div></td>
</tr>
<tr>
<td><p style="float:left"><B>Serveur DNS N° 2 : </B></p></td>
<td><div style="border:solid 1px gray;width:100px;"><input type='text' class="IP" maxLength="3" name="N17" /><b>.</b><input type='text' class="IP" maxLength="3" name="N18" /><b>.</b><input type='text' class="IP" maxLength="3" name="N19" /><b>.</b><input type='text' class="IP" maxLength="3" name="N20" />
</div></td>
</tr>
</table>
</fieldset>
<br>
<center><input type="Submit" class="button" style="cursor:hand;" value="Vérifier les @IP" name="Check" onClick="CheckIP()" style="font-weight: bold">
<input type="button" class="button" style="cursor:hand;" value="IP Publique" name="Reload" onClick="TestConnexion()" style="font-weight: bold"><p>
<body>
</html> |
Partager