Имя пользователя:
Пароль:
 

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

Новый участник


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

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


Спасибо!)))
С вашей помощью доработал для Шести файлов.
Вроде работает!)))

Код: Выделить весь код
Dim fName_1
Dim fName_2
Dim fName_3
Dim fName_4
Dim fName_5
Dim fName_6
Dim objFSO
Dim txtFile
Dim strMsg
Dim strMsg_1
Dim strMsg_2
Dim strMsg_3
Dim strMsg_4
Dim strMsg_5
Dim strMsg_6
Dim STR
Dim STR1
Dim STR2
Dim STR3
Dim STR4
Dim STR5
Dim STR6
Dim objCDO
Dim Conf

fName_1 = "c:\scriptcheckcrl\GEgarant.txt"
fName_2 = "c:\scriptcheckcrl\GEgarant2.txt"
fName_3 = "c:\scriptcheckcrl\CA1garant.txt"
fName_4 = "c:\scriptcheckcrl\CA1garant2.txt"
fName_5 = "c:\scriptcheckcrl\CA2garant.txt"
fName_6 = "c:\scriptcheckcrl\CA2garant2.txt"

Set objFSO= WScript.CreateObject("Scripting.FileSystemObject")

'_____________!!!!!!!!ФУНКЦИЯ НАХОЖДЕНИЯ СТРОКИ С ДАТОЙ

Function ReadLineTXT(FileName)
   Set txtFile = objFSO.OpenTextFile(FileName)
       Do While Not txtFile.AtEndOfStream
          If InStr(txtFile.ReadLine, "Следующая публикация CRL") Then
              ReadLineTXT = txtFile.ReadLine
       Exit Do
          End If
       Loop
	   txtFile.Close
	  
End Function

STR1=ReadLineTXT(fName_1)
STR2=ReadLineTXT(fName_2)
STR3=ReadLineTXT(fName_3)
STR4=ReadLineTXT(fName_4)
STR5=ReadLineTXT(fName_5)
STR6=ReadLineTXT(fName_6)

'_____________!!!!!!!!ФУНКЦИЯ СРАВНЕНИЯ ДАТЫ В ФАЙЛЕ С ТЕКУЩЕЙ

Function SMS(STR)
   If DateDiff("n", CDate(Replace(STR, "г.", "")), Now) > 9 Then
      SMS = "Просрочена"
   Else
      SMS = "Не просрочена"
   End If
End function

strMsg_1=SMS(STR1)
strMsg_2=SMS(STR2)
strMsg_3=SMS(STR3)
strMsg_4=SMS(STR4)
strMsg_5=SMS(STR5)
strMsg_6=SMS(STR6)

'_____________!!!!!!!!СРАВНЕНИЕ СТАТУСОВ КАЖДОГО ФАЙЛА

If (strMsg_1 = "Не просрочена") and (strMsg_2 = "Не просрочена") and (strMsg_3 = "Не просрочена") and (strMsg_4 = "Не просрочена") and (strMsg_5 = "Не просрочена") and (strMsg_6 = "Не просрочена") then 
	strMsg = "Не просрочена"
Else
	strMsg = "Просрочена"
End If	


'_____________!!!!!!!!СООБЩЕНИЕ НА ПОЧТОВЫЙ ЯЩИК


Set objCDO = WScript.CreateObject("CDO.Message")

objCDO.From = "Ot kogo"    
objCDO.To = "Komu"
objCDO.Subject = "Проверка CRL"
objCDO.HTMLBody = strMsg

Set Conf = objCDO.Configuration
  Conf("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2    
  Conf("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp server"
'  Conf("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  Conf("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 0
 ' Conf("http://schemas.microsoft.com/cdo/configuration/sendusername") = "Login"
 ' Conf("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Pass"
  Conf("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Conf.Fields.Update

objCDO.Send

Set objFSO = Nothing
Set objCDO = Nothing

WScript.Quit
У вас не никаких версий по уменьшению строк?

Отправлено: 17:06, 07-09-2011 | #4