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

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

Ветеран


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

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


Цитата mrxMonster:
Разъясните мне ситуацию, почему ни один человек никоим образом не прокаментировал мои вопросы? »
Задача не интересная.

Попробуйте:
Код: Выделить весь код
Option Explicit

Const ForReading       = 1

Const cdoSendUsingPort = 2
Const cdoBasic         = 1

Const strPartSchema    = "http://schemas.microsoft.com/cdo/configuration/"



Dim strLog
Dim strLine
Dim dtDateTime

strLog = "E:\Песочница\0092\123.txt"

With WScript.CreateObject("Scripting.FileSystemObject")
	If .FileExists(strLog) Then
		With .OpenTextFile(strLog, ForReading)
			Do Until .AtEndOfStream
				strLine = .ReadLine()
			Loop
			
			.Close
		End With
		
		dtDateTime = CDate(Split(strLine)(0) & " " & Split(strLine)(1))
		
		If DateDiff("d", dtDateTime, Now()) <= 1 Then
			If UCase(Split(strLine)(3)) = UCase("Warning") Then
				With WScript.CreateObject("CDO.Message")
					With .Configuration.Fields
						.Item(strPartSchema & "sendusing")        = cdoSendUsingPort
						.Item(strPartSchema & "smtpauthenticate") = cdoBasic
						.Item(strPartSchema & "smtpserver")       = "smtp.mail.ru"
						.Item(strPartSchema & "smtpserverport")   = 25
						.Item(strPartSchema & "sendusername")     = "login"
						.Item(strPartSchema & "sendpassword")     = "password"
						
						.Update
					End With
					
					.To            = "to@mail.com"
					.From          = "from@mail.com"
					.Subject       = "Subject"
					.TextBody      = strLine
					
					.Send
				End With
			End If
		End If
	Else
		WScript.Echo "File [" & strLog & "] not found"
	End If
End With

WScript.Quit 0
Вариант скрипта не оптимален: нужно знать, что это за лог, как часто в него пишется информация, каков его средний размер.
Это сообщение посчитали полезным следующие участники:

Отправлено: 21:38, 24-11-2011 | #4