Advertisement
Guest User

Ablaufdatum einer EEx-Lizenz prüfen

a guest
Feb 9th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.89 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=ico\ico.ico
  3. #AutoIt3Wrapper_UseX64=y
  4. #AutoIt3Wrapper_Res_LegalCopyright=Roman Gorbachov
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6.  
  7. #include <Array.au3>
  8. #include <Date.au3>
  9.  
  10. Const $ExitCode = -1293
  11. Global $eexPath = "license"
  12.  
  13. $content = FileRead(@ScriptDir & "\" & $eexPath)
  14. $date = StringRegExp($content,'Expire=(\d{10})', 3) ;UNIX-Timestamp ohne Millisekunden
  15. $date = $date[0]
  16. $jetztDate = _DateDiff('s', "1970/01/01 00:00:00", _NowCalc()) ;UNIX-Timestamp
  17.  
  18. If $jetztDate <= $date Then
  19.     ;MsgBox(64, "", "Jetzt: " & $jetztDate & " Lizenz: " & $date)
  20.     MsgBox(64,"DOCUMENTS-Lizenz","Die Lizenzdatei ist gültig",1)
  21. Else
  22.     _ExitCode()
  23. EndIf
  24.  
  25. Func _ExitCode()
  26.     MsgBox(16,"Ablaufdatum überschritten","Lizenzdatei abgelaufen" & @CRLF & @CRLF & "Pfad: " & $eexPath, 10)
  27.     Exit $ExitCode
  28. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement