Jump to content

FileGetTime on Internet ?


Recommended Posts

I know esixts function like FileGetTime, its easy to use and I like it...

But how can I get date and time from file on internet ?

Fox example I have file: http://nfk.pro2d.ru/files/trx-update2/xbot.dll

and I need to know the date when he was modified to make my update program work :)

[RU] Zone
Link to comment
Share on other sites

With a packet sniffer I could check the HTTP communication when you download the file.

First, you send a GET request:

GET /files/trx-update2/xbot.dll HTTP/1.1
Host: nfk.pro2d.ru
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive

The response is like that:

HTTP/1.1 200 OK
Date: Sun, 08 Jan 2012 08:59:26 GMT
Server: Apache/2.2.19 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
Last-Modified: Thu, 05 Jan 2012 17:28:44 GMT
ETag: "2002197-97200-4b5cb439a0b00"
Accept-Ranges: bytes
Content-Length: 619008
Connection: close
Content-Type: application/x-msdownload


[.dll DATA HERE]

At least the last modification date is there.

Link to comment
Share on other sites

  • Moderators

I was asked to look at this thread. It is indeed a gaming site that the OP is trying to access - but all he is trying to do is to read the DTG of a file, not automate a game. I am happy for it to continue.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Local $oErrorHandler = ObjEvent('AutoIt.Error', 'ObjErrorHandler')
;
Local $rtn = WinHttp_GetHeader('http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe')
If Not @error Then MsgBox(0, '', $rtn)
;
Func WinHttp_GetHeader($sLink)
    Local $str, $objHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    If IsObj($objHTTP) Then
        $objHTTP.SetTimeouts(5000, 5000, 5000, 5000)
        $objHTTP.Open('HEAD', $sLink, False)
        $objHTTP.Send()
        If (Not @error) And ($objHTTP.Status = 200) Then
            $str = $objHTTP.GetResponseHeader('Last-Modified')
            ;$str = $objHTTP.GetAllResponseHeaders
            If Not @error Then Return SetError(0, 0, $str)
        EndIf
    EndIf
    Return SetError(-1, 0, -1)
EndFunc
;
Func ObjErrorHandler()
    MsgBox(8240, 'Error', $oErrorHandler.Description)
    Return SetError(-1, 0, -1)
EndFunc
;

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...