% ' ' Put this in your asp file ' Response.Write (IncludeURL("http://www.domain.com/path/file.ext?params=value")) ' Function IncludeURL(URL) 'Create an Http object, use any of the four objects Dim Http ' Set Http = CreateObject("Microsoft.XMLHTTP") ' Set Http = CreateObject("MSXML2.ServerXMLHTTP") Set Http = CreateObject("WinHttp.WinHttpRequest.5.1") ' Set Http = CreateObject("WinHttp.WinHttpRequest") 'Send request To URL Http.Open "GET", URL, False Http.Send 'Retrieves the response entity body as a string IncludeURL = Http.ResponseText End Function ' ' Put this in your asp file ' Response.Write (LastModified()) ' Function LastModified() ' Local variables Dim loFs, lsFile, lsPath, loFile, ldLast ' Create an instance of FileSystemObject object Set loFs = CreateObject("Scripting.FileSystemObject") ' Get the logical path of the current file ' (i.e. the file in which this code runs) lsFile = Request.ServerVariables("SCRIPT_NAME") ' Get the physical path of the file lsPath = Server.MapPath(lsFile) ' Get a handle/pointer to this file Set loFile = loFs.GetFile(lsPath) ' Get the "Last Modified" property of this file ldLast = loFile.DateLastModified ' Release the objects Set loFile = Nothing Set loFs = Nothing ' Write out the date in the long date ' format e.g. "MM/DD/YY" ' vbGeneralDate 0 Display a date and/or time. If there is a date part, display it as a short date. If there is a time part, display it as a long time. If present, both parts are displayed. ' vbLongDate 1 Display a date using the long date format specified in your computer's regional settings. ' vbShortDate 2 Display a date using the short date format specified in your computer's regional settings. ' vbLongTime 3 Display a time using the time format specified in your computer's regional settings. ' vbShortTime 4 Display a time using the 24-hour format (hh:mm). LastModified = CStr(FormatDateTime(ldLast, 1) & " " & FormatDateTime(ldLast, 4)) End Function ' ' Tracker for keeping score of hits to a site ' dir = string with path for this tracker ' Function Tracker(dir) ' Define some local stuff Dim path, date, ext, file, fso, fh, counter path = "C:/inetpub/vhosts/innebandy.no/httpdocs/web-data/tracker/" date = Year(now) & "_" & Right("00" & Month(now) ,2) & "_" & Right("00" & Day(now) ,2) ext = ".tracker" file = path & dir & "/" & date & ext ' Create FileSystemObject Set fso = CreateObject("Scripting.FileSystemObject") ' Read counter and increment if file exists If fso.FileExists(file) = True Then Set fh = fso.OpenTextFile(file) counter = CLng(fh.ReadLine) fh.Close counter = counter + 1 Else counter = 1 End if ' Write counter Set fh = fso.OpenTextFile(file, 2, true) fh.WriteLine(counter) fh.Close ' Release objects Set fso = Nothing Set fh = Nothing Tracker = CStr(counter) End Function %>
Any questions, comments or updates, please contact Webmaster.
Copyrights & Disclaimer