Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8086

Профиль | Отправить PM | Цитировать


aggressor_, ясно. Пробуйте, скрипт WSH, не требующий сторонних средств:
Код: Выделить весь код
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

Последний раз редактировалось Iska, 28-02-2012 в 00:52. Причина: Добавлена просьба из поста #9

Это сообщение посчитали полезным следующие участники:

Отправлено: 23:01, 27-02-2012 | #8