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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596
|
<html>
<HTA:APPLICATION
SCROLL="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="no"
CAPTION="yes"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="yes"
SYSMENU="yes"
BORDER="thin"
BORDERSTYLE="Normal"
CONTEXTMENU="no"
SELECTION="no">
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
<head>
<OBJECT ID="objShell" CLASSID="clsid:{72C24DD5-D70A-438B-8A42-98424B88AFB8}" ProgID="WScript.Shell.1"></OBJECT>
<title>NewChangeIP 1.0.0</title>
<style type='text/css'>
BODY {background:ButtonFace;}
.button {
border-size: 0px;
border-style: none;
background: inherit;
width: 120px;
font-size:14px;
color: blue;
cursor: hand;
cursor: pointer;
padding: 0px;
border-radius: 10px 10px 10px 10px;
}
.bouton {
background: #c9c9c9;
background-image: -webkit-linear-gradient(top, #c9c9c9, #333333);
background-image: -moz-linear-gradient(top, #c9c9c9, #333333);
background-image: -ms-linear-gradient(top, #c9c9c9, #333333);
background-image: -o-linear-gradient(top, #c9c9c9, #333333);
background-image: linear-gradient(to bottom, #c9c9c9, #333333);
-webkit-border-radius: 13;
-moz-border-radius: 13;
border-radius: 13px;
font-family: Arial;
color: #ffffff;
font-size: 15px;
padding: 10px 20px 10px 20px;
text-decoration: none;
}
.bouton:hover {
text-decoration: none;
}
.bouton:active {
position:relative;
top:1px;
}
input {
background-color:ButtonFace;
text-align:center;
}
body
{
background-color:#9DC5FF;
}
.Intro
{
background-color:#5195FA;
align:center;
height : 30px;
width : 100%;
font:bold;
border-radius: 10px 10px 10px 10px;
}
</style>
</head>
<body>
<table border="2" width="315">
<tr>
<td><SPAN class="intro"><center>Changement d'adresse IP</center></SPAN> </td>
</tr>
</table>
<table border="2">
<form name="ValidForm">
<td>Intitulé IP:</td>
<td class="blue">
<input maxlength="27" type='text' class="IP" name="Intitule" size="27"></td><tr>
<td>Adresse IP :</td>
<td class="blue">
<input maxlength="3" type='text' class="IP" onKeyUp="IPCheckAdrIpStation01()" name="AdrIpStation01" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IPCheckAdrIpStation02()" name="AdrIpStation02" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IPCheckAdrIpStation03()" name="AdrIpStation03" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IPCheckAdrIpStation04()" name="AdrIpStation04" size="3"></td><tr>
<td>Masque:</td>
<td class="blue">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrSmStation01()" name="AdrSmStation01" size="3" value="255">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrSmStation02()" name="AdrSmStation02" size="3" value="255">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrSmStation03()" name="AdrSmStation03" size="3" value="255">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrSmStation04()" name="AdrSmStation04" size="3" value="0"></td><tr>
<td>Passerelle:</td>
<td class="blue">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrRouStation01()" name="AdrRouStation01" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrRouStation02()" name="AdrRouStation02" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrRouStation03()" name="AdrRouStation03" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrRouStation04()" name="AdrRouStation04" size="3" value="1"></td><tr>
<td>Adresse DNS 1 :</td>
<td class="blue">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS101()" name="AdrIpDNS101" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS102()" name="AdrIpDNS102" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS103()" name="AdrIpDNS103" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS104()" name="AdrIpDNS104" size="3"></td><tr>
<td>Adresse DNS 2 :</td>
<td class="blue">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS201()" name="AdrIpDNS201" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS202()" name="AdrIpDNS202" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS203()" name="AdrIpDNS203" size="3">
<input maxlength="3" type='text' class="IP" onKeyUp="IpCheckAdrIpDNS204()" name="AdrIpDNS204" size="3"></td><tr>
<tr>
</table>
<center><INPUT TYPE="button" NAME="appliquer" class="bouton" style="width:55px" VALUE="OK" onclick="Valider()">
<INPUT TYPE="button" NAME="annuler" class="bouton" VALUE="Annuler" onclick="Annuler()">
<INPUT TYPE="button" NAME="ajouter" class="bouton" VALUE="Ajouter" onclick="AjouterIP()">
<INPUT TYPE="button" NAME="selectionner" class="bouton" VALUE="Selectionner" onclick="GetIPConfig(PathFichParam)">
</center>
<td class="right">
<table border="0" cellpadding="0" cellspacing="10">
<select name="listeIP" size="10"></select>
</table>
</form>
<script language="VBScript" defer=true>
window.moveTo 510,200
Sub Window_OnLoad
CenterWindow 360,550
End Sub
Set fso=CreateObject("Scripting.filesystemObject")
sourcepath = objShell.CurrentDirectory
PathFichParam=sourcepath & "\param"
Dim NbrIP
NbrIP=0
Dim ListeIP(50,6)
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
Sub AjouterIP()
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Sleep "1"
if not fso.FileExists(PathFichParam&"\preferes.ini") then
fso.CreateTextFile PathFichParam&"\preferes.ini"
end if
Set fichIP=fso.OpenTextFile(PathFichParam&"\preferes.ini",ForAppending)
fichIP.WriteLine ("Intitule=") & ValidForm.Intitule.value
fichIP.WriteLine ("IP=") & ValidForm.AdrIpStation01.value & "." & ValidForm.AdrIpStation02.value & "." & ValidForm.AdrIpStation03.value & "." & ValidForm.AdrIpStation04.value
fichIP.WriteLine ("Masque=") & ValidForm.AdrSmStation01.value & "." & ValidForm.AdrSmStation02.value & "." & ValidForm.AdrSmStation03.value & "." & ValidForm.AdrSmStation04.value
fichIP.WriteLine ("Passerelle=") & ValidForm.AdrRouStation01.value & "." & ValidForm.AdrRouStation02.value & "." & ValidForm.AdrRouStation03.value & "." & ValidForm.AdrRouStation04.value
fichIP.WriteLine ("DNS1=") & ValidForm.AdrIpDNS101.value & "." & ValidForm.AdrIpDNS102.value & "." & ValidForm.AdrIpDNS103.value & "." & ValidForm.AdrIpDNS104.value
fichIP.WriteLine ("DNS2=") & ValidForm.AdrIpDNS201.value & "." & ValidForm.AdrIpDNS202.value & "." & ValidForm.AdrIpDNS203.value & "." & ValidForm.AdrIpDNS204.value
fichIP.WriteLine ""
fichIP.close
'Ouverture et mise à jour de la liste des IP
if not fso.FileExists(PathFichParam&"\preferes.ini") then
fso.CreateTextFile PathFichParam&"\preferes.ini"
end if
End Sub
Function GetIPConfig (PathFichParam)
Dim AdrIp, Masque, Passerelle, AdrDNS1, AdrDNS2
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Sleep "1"
Set fichPref=fso.OpenTextFile(PathFichParam&"\preferes.ini",ForReading) 'Ouvre preferes.ini
Do Until fichPref.AtEndOfStream
strTemp = fichPref.readline
If Ucase("IP") = Ucase(Split(StrTemp,"=",2,1)(0)) Then
AdrIp = Ucase(Split(StrTemp,"=",2,1)(1))
End if
If Ucase("MASQUE") = Ucase(Split(StrTemp,"=",2,1)(0)) Then
Masque = Ucase(Split(StrTemp,"=",2,1)(1))
End if
If Ucase("PASSERELLE") = Ucase(Split(StrTemp,"=",2,1)(0)) Then
Passerelle = Ucase(Split(StrTemp,"=",2,1)(1))
End if
If Ucase("DNS1") = Ucase(Split(StrTemp,"=",2,1)(0)) Then
AdrDNS1 = Ucase(Split(StrTemp,"=",2,1)(1))
End if
If Ucase("DNS2") = Ucase(Split(StrTemp,"=",21,1)(0)) Then
AdrDNS2 = Ucase(Split(StrTemp,"=",2,1)(1))
End if
Loop
objShell.Run "netsh interface ip set address name=""Connexion au réseau local"" static " & AdrIP & " " & Masque & " " & Passerelle & " " & 1, 0, True
objShell.Run "netsh interface ip set dns name=""Connexion au réseau local"" static "& AdrDNS1, 0, True
objShell.Run "netsh interface ip add dns name=""Connexion au réseau local"" addr="& AdrDNS2, 0, True
MsgBox "Changement d'ip appliqué avec succès !" ,vbInformation+VBtittle
End Function
Sub Selectionner_OnClick
if ValidForm.listeIP.value="" then
msgbox ("Veuillez sélectionner une adresse IP")
end if
End Sub
Sub Valider()
Dim Ips
Dim Mask
Dim Gateways
Dim DNS1
Dim DNS2
Ips = ValidForm.AdrIpStation01.value & "." & ValidForm.AdrIpStation02.value & "." & ValidForm.AdrIpStation03.value & "." & ValidForm.AdrIpStation04.value
Mask = ValidForm.AdrSmStation01.value & "." & ValidForm.AdrSmStation02.value & "." & ValidForm.AdrSmStation03.value & "." & ValidForm.AdrSmStation04.value
Gateways = ValidForm.AdrRouStation01.value & "." & ValidForm.AdrRouStation02.value & "." & ValidForm.AdrRouStation03.value & "." & ValidForm.AdrRouStation04.value
DNS1 = ValidForm.AdrIpDNS101.value & "." & ValidForm.AdrIpDNS102.value & "." & ValidForm.AdrIpDNS103.value & "." & ValidForm.AdrIpDNS104.value
DNS2 = ValidForm.AdrIpDNS201.value & "." & ValidForm.AdrIpDNS202.value & "." & ValidForm.AdrIpDNS203.value & "." & ValidForm.AdrIpDNS204.value
objShell.Run "netsh interface ip set address name=""Connexion au réseau local"" static " & Ips & " " & Mask & " " & Gateways & " " & 1, 0, True
objShell.Run "netsh interface ip set dns name=""Connexion au réseau local"" static "& DNS1, 0, True
objShell.Run "netsh interface ip add dns name=""Connexion au réseau local"" addr="& DNS2, 0, True
MsgBox "Changement d'ip appliqué avec succès !" ,vbInformation+VBtittle
End Sub
Sub Annuler()
MsgBox "Abandon du changement de l'adresse IP et application des paramètres par défauts",vbInformation+VBtittle,"Assistant Création collection"
objShell.Run "netsh interface IPv4 set address name=""Connexion au réseau local"" DHCP", 0, True
objShell.Run "netsh interface ip set wins ""Connexion au réseau local"" DHCP", 0, True
objShell.Run "netsh interface ip set dns ""Connexion au réseau local"" DHCP", 0, True
End Sub
Sub IPCheckAdrIpStation01()
On Error Resume Next
If ValidForm.AdrIpStation01.Value > 255 OR IsNumeric(ValidForm.AdrIpStation01.Value) = False Then
ValidForm.AdrIpStation01.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpStation01.Value = ""
ValidForm.AdrIpStation01.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpStation01.Value) = 3 OR InStr(ValidForm.AdrIpStation01.Value, ".") > 0 Then
ValidForm.AdrIpStation01.Value=Replace(AdrIpStation01.Value,".","")
ValidForm.AdrIpStation02.Focus
ValidForm.AdrIpStation02.Select
End If
End Sub
Sub IPCheckAdrIpStation02()
On Error Resume Next
If ValidForm.AdrIpStation02.Value > 255 OR IsNumeric(ValidForm.AdrIpStation02.Value) = False Then
ValidForm.AdrIpStation02.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpStation02.Value = ""
ValidForm.AdrIpStation02.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpStation02.Value) = 3 OR InStr(ValidForm.AdrIpStation02.Value, ".") > 0 Then
ValidForm.AdrIpStation02.Value=Replace(AdrIpStation02.Value,".","")
ValidForm.AdrIpStation03.Focus
ValidForm.AdrIpStation03.Select
End If
End Sub
Sub IPCheckAdrIpStation03()
On Error Resume Next
If ValidForm.AdrIpStation03.Value > 255 OR IsNumeric(ValidForm.AdrIpStation03.Value) = False Then
ValidForm.AdrIpStation03.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpStation03.Value = ""
ValidForm.AdrIpStation03.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpStation03.Value) = 3 OR InStr(ValidForm.AdrIpStation03.Value, ".") > 0 Then
ValidForm.AdrIpStation03.Value=Replace(AdrIpStation03.Value,".","")
ValidForm.AdrIpStation04.Focus
ValidForm.AdrIpStation04.Select
End If
End Sub
Sub IPCheckAdrIpStation04()
On Error Resume Next
If ValidForm.AdrIpStation04.Value > 255 OR IsNumeric(ValidForm.AdrIpStation04.Value) = False Then
ValidForm.AdrIpStation04.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpStation04.Value = ""
ValidForm.AdrIpStation04.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpStation04.Value) = 3 OR InStr(ValidForm.AdrIpStation04.Value, ".") > 0 Then
ValidForm.AdrIpStation04.Value=Replace(ValidForm.AdrIpStation04.Value,".","")
ValidForm.AdrSmStation01.Focus
ValidForm.AdrSmStation01.Select
End If
End Sub
Sub IPCheckAdrSmStation01()
On Error Resume Next
If ValidForm.AdrSmStation01.Value > 255 OR IsNumeric(ValidForm.AdrSmStation01.Value) = False Then
ValidForm.AdrSmStation01.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrSmStation01.Value = ""
ValidForm.AdrSmStation01.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrSmStation01.Value) = 3 OR InStr(ValidForm.AdrSmStation01.Value, ".") > 0 Then
ValidForm.AdrSmStation01.Value=Replace(ValidForm.AdrSmStation01.Value,".","")
ValidForm.AdrSmStation02.Focus
ValidForm.AdrSmStation02.Select
End If
End Sub
Sub IPCheckAdrSmStation02()
On Error Resume Next
If ValidForm.AdrSmStation02.Value > 255 OR IsNumeric(ValidForm.AdrSmStation02.Value) = False Then
ValidForm.AdrSmStation02.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrSmStation02.Value = ""
ValidForm.AdrSmStation02.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrSmStation02.Value) = 3 OR InStr(ValidForm.AdrSmStation02.Value, ".") > 0 Then
ValidForm.AdrSmStation02.Value=Replace(ValidForm.AdrSmStation02.Value,".","")
ValidForm.AdrSmStation03.Focus
ValidForm.AdrSmStation03.Select
End If
End Sub
Sub IPCheckAdrSmStation03()
On Error Resume Next
If ValidForm.AdrSmStation03.Value > 255 OR IsNumeric(ValidForm.AdrSmStation03.Value) = False Then
AdrSmStation03.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrSmStation03.Value = ""
ValidForm.AdrSmStation03.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrSmStation03.Value) = 3 OR InStr(ValidForm.AdrSmStation03.Value, ".") > 0 Then
ValidForm.AdrSmStation03.Value=Replace(ValidForm.AdrSmStation03.Value,".","")
ValidForm.AdrSmStation04.Focus
ValidForm.AdrSmStation04.Select
End If
End Sub
Sub IPCheckAdrSmStation04()
On Error Resume Next
If ValidForm.AdrSmStation04.Value > 255 OR IsNumeric(ValidForm.AdrSmStation04.Value) = False Then
ValidForm.AdrSmStation04.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrSmStation04.Value = ""
ValidForm.AdrSmStation04.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrSmStation04.Value) = 3 OR InStr(ValidForm.AdrSmStation04.Value, ".") > 0 Then
ValidForm.AdrSmStation04.Value=Replace(ValidForm.AdrSmStation04.Value,".","")
ValidForm.AdrIpDNS101.Focus
ValidForm.AdrIpDNS101.Select
End If
End Sub
Sub IPCheckAdrRouStation01()
On Error Resume Next
If ValidForm.AdrRouStation01.Value > 255 OR IsNumeric(ValidForm.AdrRouStation01.Value) = False Then
ValidForm.AdrRouStation01.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrRouStation01.Value = ""
ValidForm.AdrRouStation01.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrRouStation01.Value) = 3 OR InStr(ValidForm.AdrRouStation01.Value, ".") > 0 Then
ValidForm.AdrRouStation01.Value=Replace(ValidForm.AdrRouStation01.Value,".","")
ValidForm.AdrRouStation02.Focus
ValidForm.AdrRouStation02.Select
End If
End Sub
Sub IPCheckAdrRouStation02()
On Error Resume Next
If ValidForm.AdrRouStation02.Value > 255 OR IsNumeric(ValidForm.AdrRouStation02.Value) = False Then
ValidForm.AdrRouStation02.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrRouStation02.Value = ""
ValidForm.AdrRouStation02.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrRouStation02.Value) = 3 OR InStr(ValidForm.AdrRouStation02.Value, ".") > 0 Then
ValidForm.AdrRouStation02.Value=Replace(ValidForm.AdrRouStation02.Value,".","")
ValidForm.AdrRouStation03.Focus
ValidForm.AdrRouStation03.Select
End If
End Sub
Sub IPCheckAdrRouStation03()
On Error Resume Next
If ValidForm.AdrRouStation03.Value > 255 OR IsNumeric(ValidForm.AdrRouStation03.Value) = False Then
ValidForm.AdrRouStation03.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrRouStation03.Value = ""
ValidForm.AdrRouStation03.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrRouStation03.Value) = 3 OR InStr(ValidForm.AdrRouStation03.Value, ".") > 0 Then
ValidForm.AdrRouStation03.Value=Replace(ValidForm.AdrRouStation03.Value,".","")
ValidForm.AdrRouStation04.Focus
ValidForm.AdrRouStation04.Select
End If
End Sub
Sub IPCheckAdrRouStation04()
On Error Resume Next
If ValidForm.AdrRouStation04.Value > 255 OR IsNumeric(ValidForm.AdrRouStation04.Value) = False Then
ValidForm.AdrRouStation04.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrRouStation04.Value = ""
ValidForm.AdrRouStation04.style.backgroundcolor = "Buttonface"
End If
If Len(AdrRouStation04.Value) = 3 OR InStr(ValidForm.AdrRouStation04.Value, ".") > 0 Then
ValidForm.AdrRouStation04.Value=Replace(ValidForm.AdrRouStation04.Value,".","")
ValidForm.AdrIpDNS101.Focus
ValidForm.AdrIpDNS101.Select
End If
End Sub
Sub IPCheckAdrIpDNS101()
On Error Resume Next
If ValidForm.AdrIpDNS101.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS101.Value) = False Then
ValidForm.AdrIpDNS101.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS101.Value = ""
ValidForm.AdrIpDNS101.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS101.Value) = 3 OR InStr(ValidForm.AdrIpDNS101.Value, ".") > 0 Then
ValidForm.AdrIpDNS101.Value=Replace(ValidForm.AdrIpDNS101.Value,".","")
ValidForm.AdrIpDNS102.Focus
ValidForm.AdrIpDNS102.Select
End If
End Sub
Sub IPCheckAdrIpDNS102()
On Error Resume Next
If ValidForm.AdrIpDNS102.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS102.Value) = False Then
ValidForm.AdrIpDNS102.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS102.Value = ""
ValidForm.AdrIpDNS102.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS102.Value) = 3 OR InStr(ValidForm.AdrIpDNS102.Value, ".") > 0 Then
ValidForm.AdrIpDNS102.Value=Replace(ValidForm.AdrIpDNS102.Value,".","")
ValidForm.AdrIpDNS103.Focus
ValidForm.AdrIpDNS103.Select
End If
End Sub
Sub IPCheckAdrIpDNS103()
On Error Resume Next
If ValidForm.AdrIpDNS103.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS103.Value) = False Then
ValidForm.AdrIpDNS103.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS103.Value = ""
ValidForm.AdrIpDNS103.style.backgroundcolor = "Buttonface"
End If
If Len(AdrIpDNS103.Value) = 3 OR InStr(ValidForm.AdrIpDNS103.Value, ".") > 0 Then
ValidForm.AdrIpDNS103.Value=Replace(ValidForm.AdrIpDNS103.Value,".","")
ValidForm.AdrIpDNS104.Focus
ValidForm.AdrIpDNS104.Select
End If
End Sub
Sub IPCheckAdrIpDNS104()
On Error Resume Next
If ValidForm.AdrIpDNS104.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS104.Value) = False Then
ValidForm.AdrIpDNS104.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS104.Value = ""
ValidForm.AdrIpDNS104.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS104.Value) = 3 OR InStr(ValidForm.AdrIpDNS104.Value, ".") > 0 Then
ValidForm.AdrIpDNS104.Value=Replace(AdrIpDNS104.Value,".","")
ValidForm.AdrIpDNS201.Focus
ValidForm.AdrIpDNS201.Select
End If
End Sub
Sub IPCheckAdrIpDNS201()
On Error Resume Next
If ValidForm.AdrIpDNS201.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS201.Value) = False Then
ValidForm.AdrIpDNS201.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS201.Value = ""
ValidForm.AdrIpDNS201.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS201.Value) = 3 OR InStr(ValidForm.AdrIpDNS201.Value, ".") > 0 Then
ValidForm.AdrIpDNS201.Value=Replace(AdrIpDNS201.Value,".","")
ValidForm.AdrIpDNS202.Focus
ValidForm.AdrIpDNS202.Select
End If
End Sub
Sub IPCheckAdrIpDNS202()
On Error Resume Next
If ValidForm.AdrIpDNS202.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS202.Value) = False Then
ValidForm.AdrIpDNS202.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS202.Value = ""
ValidForm.AdrIpDNS202.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS202.Value) = 3 OR InStr(ValidForm.AdrIpDNS202.Value, ".") > 0 Then
ValidForm.AdrIpDNS202.Value=Replace(AdrIpDNS202.Value,".","")
ValidForm.AdrIpDNS203.Focus
ValidForm.AdrIpDNS203.Select
End If
End Sub
Sub IPCheckAdrIpDNS203()
On Error Resume Next
If ValidForm.AdrIpDNS203.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS203.Value) = False Then
ValidForm.AdrIpDNS203.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS203.Value = ""
ValidForm.AdrIpDNS203.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS203.Value) = 3 OR InStr(ValidForm.AdrIpDNS203.Value, ".") > 0 Then
ValidForm.AdrIpDNS203.Value=Replace(AdrIpDNS203.Value,".","")
ValidForm.AdrIpDNS204.Focus
ValidForm.AdrIpDNS204.Select
End If
End Sub
Sub IPCheckAdrIpDNS204()
On Error Resume Next
If ValidForm.AdrIpDNS204.Value > 255 OR IsNumeric(ValidForm.AdrIpDNS204.Value) = False Then
ValidForm.AdrIpDNS204.style.backgroundcolor = "red"
Sleep "1"
ValidForm.AdrIpDNS204.Value = ""
ValidForm.AdrIpDNS204.style.backgroundcolor = "Buttonface"
End If
If Len(ValidForm.AdrIpDNS204.Value) = 3 OR InStr(ValidForm.AdrIpDNS204.Value, ".") > 0 Then
ValidForm.AdrIpDNS204.Value=Replace(ValidForm.AdrIpDNS204.Value,".","")
Check.Focus
Check.Select
End If
End Sub
sub AdrIpStation01_onchange()
ValidForm.AdrRouStation01.value = ValidForm.AdrIpStation01.value
End sub
sub AdrIpStation02_onchange()
ValidForm.AdrRouStation02.value = ValidForm.AdrIpStation02.value
End sub
sub AdrIpStation03_onchange()
ValidForm.AdrRouStation03.value = ValidForm.AdrIpStation03.value
End sub
Sub Sleep(MSecs)
Set fso = CreateObject("Scripting.FileSystemObject")
Dim tempFolder : Set tempFolder = fso.GetSpecialFolder(2)
Dim tempName : tempName = "Sleeper.vbs"
If Fso.FileExists(tempFolder&"\"&tempName)=False Then
Set objOutputFile = fso.CreateTextFile(tempFolder&"\"&tempName, True)
objOutputFile.Write "wscript.sleep WScript.Arguments(0)"
objOutputFile.Close
End If
CreateObject("WScript.Shell").Run tempFolder&"\"&tempName &" "& MSecs,1,True
End Sub
</script>
</body>
</html> |
Partager