Calculate file download time

xiaoxiao2021-03-06  120

Calculate file download time

<% Function DownloadTime (intFileSize, strModemType) Dim TimeInSeconds, ModemSpeed, strDownloadTime, AppendString Dim intYears, intWeeks, intDays Dim intHours, intMinutes, intSeconds intYears = 0 intWeeks = 0 intDays = 0 intHours = 0 intMinutes = 0 intSeconds = 0 strDownloadTime = " "Select Case strModemType Case" Cable "ModemSpeed ​​= 400000 Case" 56kbps "ModemSpeed ​​= 7000 Case" 33.6kbps "ModemSpeed ​​= 4200 Case" 28.8kbps "ModemSpeed ​​= 3600 End Select TimeInSeconds = int (intFileSize / ModemSpeed) 'year maths added 1 / 4 of a day. 1 Exact Orbit of the Sub IS 365.25 Days. IF (INT (TimeInseconds / 31471200) <> 0) THEN INTYEARS = INT (TimeInseconds / 31449600) IF ((INT (TimeInseconds / 604800) MOD 52) <> 0) THEN INTWEEKS = INT (TimeInseconds / 604800) MOD 52 IF ((INT (TimeInseconds / 86400) MOD 7) <> 0) THEN INTDAYS = INT (TimeInseconds / 86400) MOD 7 if TimeInseconds> = 3600 THEN INTHOURS = INT TimeInseconds / 3600) MOD 24 if TimeInseconds> = 60 THEN INTMINUTES = INT (TimeInseconds / 60) MOD 60 IF Ti meInSeconds> = 0 Then intSeconds = Int (TimeInSeconds) Mod 60 If intYears <> 0 Then If intYears = 1 Then AppendString = "" Else AppendString = "s" strDownloadTime = strDownloadTime & intYears & "year" & AppendString & "," End If If intWeeks <> 0 Then If intWeeks = 1 Then AppendString = "" Else AppendString = "s" strDownloadTime = strDownloadTime & intWeeks & "week" & AppendString & "," End If If intDays <> 0 Then If intDays =

1 Then AppendString = "" Else AppendString = "s" strDownloadTime = strDownloadTime & intDays & "day" & AppendString & "," End If If intHours <> 0 Then If intHours = 1 Then AppendString = "" Else AppendString = "s" strDownloadTime = strDownloadTime & intHours & "hour" & AppendString & "," End If If intMinutes <> 0 Then If intMinutes = 1 Then AppendString = "" Else AppendString = "s" strDownloadTime = strDownloadTime & intMinutes & "minute" & AppendString End IF if (intWeeks = 0) and (intWeeks = 0) AND (intWeeks = 0) and (intHours = 0)) Then if Intseconds = 1 Then appendstring = "" Else appendstring = "s" if Intminutes> 0 Then strDMinLoadTime = strDownloadTime & "," & intSeconds & "second" & AppendString Else strDownloadTime = strDownloadTime & intSeconds & "second" & AppendString End If End If downloadTime = strDownloadTime End Function%> It is going to take about <% = DownloadTime (123456, Cable)%> To Download this file.

转载请注明原文地址:https://www.9cbs.com/read-100312.html

New Post(0)