D
D. Shane Fowlkes
Here's a good one. I've been using an Excel spreadsheet for the past couple
of years to calculate a file's Estimated Download Time based off of a solid
50kbs connection (dial up). This is for a downloads page such as:
http://www.drpt.virginia.gov/downloads/selectedcat.aspx?ID=12
The formula is basically this:
=(((C4*1000*8)/50000)/84600)*1.1
(Estimate is calculated on a modem dial up connection of 50Kbs and transfer
loss of 10% due to the modulation and demodulation that modems must perform
with a dial up connection.)
"C4" would be where I plug in the KB size such as "482" and it gives me a
estimated download time of 1:27 (mm:ss). The cell that returns this is
formatted as time.
Now, I'm trying to write a VB.NET (ASP) function that calculates this for me
when the record is automatically inserted in the table. The field that holds
this "EDT" is simply a text field and I've alway manually calculated this
with the Excel file and typed it in.
I've tried the Function below but not having a lot of luck. Not getting
errors...just no conversion seems to work. If I KEEP the
ToString("hh:mm:ss
, I literally get "hh:mm:ss: inserted into the database.
If I remove it and simply Return dblEDT, I get " 0.000128183026004728" for a
file size of 482KB.
Does any of this make sense? Any sugguestions?
Function CalculateDownloadTime(intFileSize As Integer) As String
' Estimate is calculated on a modem dial up connection of 50Kbs and transfer
loss
' of 10% due to the modulation and demodulation that modems must perform
with
' a dial up connection.
Dim dblEDT As Double
dblEDT = (((intFileSize)/50000)/84600)*1.1
Return dblEDT.ToString("hh:mm:ss")
End Function
of years to calculate a file's Estimated Download Time based off of a solid
50kbs connection (dial up). This is for a downloads page such as:
http://www.drpt.virginia.gov/downloads/selectedcat.aspx?ID=12
The formula is basically this:
=(((C4*1000*8)/50000)/84600)*1.1
(Estimate is calculated on a modem dial up connection of 50Kbs and transfer
loss of 10% due to the modulation and demodulation that modems must perform
with a dial up connection.)
"C4" would be where I plug in the KB size such as "482" and it gives me a
estimated download time of 1:27 (mm:ss). The cell that returns this is
formatted as time.
Now, I'm trying to write a VB.NET (ASP) function that calculates this for me
when the record is automatically inserted in the table. The field that holds
this "EDT" is simply a text field and I've alway manually calculated this
with the Excel file and typed it in.
I've tried the Function below but not having a lot of luck. Not getting
errors...just no conversion seems to work. If I KEEP the
ToString("hh:mm:ss
If I remove it and simply Return dblEDT, I get " 0.000128183026004728" for a
file size of 482KB.
Does any of this make sense? Any sugguestions?
Function CalculateDownloadTime(intFileSize As Integer) As String
' Estimate is calculated on a modem dial up connection of 50Kbs and transfer
loss
' of 10% due to the modulation and demodulation that modems must perform
with
' a dial up connection.
Dim dblEDT As Double
dblEDT = (((intFileSize)/50000)/84600)*1.1
Return dblEDT.ToString("hh:mm:ss")
End Function