Enforcer Posted January 8, 2012 Share Posted January 8, 2012 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 More sharing options...
TheGeneral Posted January 8, 2012 Share Posted January 8, 2012 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 More sharing options...
Emiel Wieldraaijer Posted January 8, 2012 Share Posted January 8, 2012 Why not download the complete file it's only 600 kb, isn't there information posted on a website ? Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 8, 2012 Moderators Share Posted January 8, 2012 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted January 8, 2012 Share Posted January 8, 2012 @Melba23, indeed nothing wrong here Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
ripdad Posted January 8, 2012 Share Posted January 8, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now