$sURL = "http://autoit-script.ru/index.php?action=downloads;sa=downfile&id=83"
$sHost = StringRegExpReplace($sURL, ".*://(.*?)/.*", "\1")
$sPage = StringRegExpReplace($sURL, ".*://.*?(/.*)", "\1")
$sResponse = _HTTPGetResponse($sHost, $sPage)
$sRet = StringRegExpReplace($sResponse, "(?s).*Last-Modified: (.*?)[\r\n].*", "\1")
MsgBox(64, "File Hedaer", $sResponse)
MsgBox(64, "Last-Modified", $sRet)
Func _HTTPGetResponse($sHost, $sPage)
TCPStartup()
Local $sName_To_IP = TCPNameToIP($sHost)
Local $iSocket = TCPConnect($sName_To_IP, 80)
If $iSocket = -1 Then
TCPShutdown()
Return SetError(1, 0, "")
EndIf
Local $sCommand = "HEAD " & $sPage & " HTTP/1.1" & @CRLF
$sCommand &= "Host: " & $sHost & @CRLF
$sCommand &= "User-Agent: AutoIt/" & @AutoItVersion & " (Windows; U; Windows NT 5.1; en-US; rv:1.8.1)" & @CRLF
$sCommand &= "Referer: " & $sHost & @CRLF
$sCommand &= "Connection: close" & @CRLF & @CRLF
Local $BytesSent = TCPSend($iSocket, $sCommand)
If $BytesSent = 0 Then
TCPShutdown()
Return SetError(2, @error, 0)
EndIf
Local $sRecv = "", $sCurrentRecv
While 1
$sCurrentRecv = TCPRecv($iSocket, 16)
If @error <> 0 Then
ExitLoop
EndIf
If $sCurrentRecv <> "" Then
$sRecv &= $sCurrentRecv
EndIf
WEnd
TCPCloseSocket($iSocket)
TCPShutdown()
Return $sRecv
EndFunc