Здравствуйте,
Iska! Будьте любезны, внесите изменение в данный скрипт из поста
№8, что бы в конце IP отображалась дата и время записи, буду вам очень благодарен.
Пример:
118.151.161.70 (07.02.2019 / 07:31)
122.221.141.20 (07.02.2019 / 07:39)
И т.д...
Цитата Iska:
Option Explicit
Const ForAppending = 8
Const strPreviousIPList = "PreviousIPList.txt"
Dim strIP
Dim boolIPExists
With WScript.CreateObject("Microsoft.XMLHTTP")
.open "GET", "http://ifconfig.me/ip", False
.send
strIP = Replace(.responseText, vbLf, "")
End With
boolIPExists = False
With WScript.CreateObject("Scripting.FileSystemObject")
If .FileExists(strPreviousIPList) Then
With .OpenTextFile(strPreviousIPList)
Do Until .AtEndOfStream
If .ReadLine() = strIP Then
boolIPExists = True
Exit Do
End If
Loop
.Close
End With
End If
If boolIPExists Then
MsgBox "IP exists", vbOKOnly + vbExclamation, "IP exists"
Else
With .OpenTextFile(strPreviousIPList, ForAppending, True)
.WriteLine strIP
.Close
End With
MsgBox "IP [" & strIP & "] append", vbOKOnly + vbInformation, "IP append"
End If
End With
WScript.Quit 0 »
|