Function readBinFromFile(ByVal bfilename As String) As Variant
Dim fl As Long
Dim FileNum As Long
Dim binbyte() As Byte
Dim binfilestr As String
On Error GoTo errHandler
FileNum = FreeFile
Open bfilename For Binary As #FileNum
fl = FileLen(bfilename)
ReDim binbyte(fl)
Get #FileNum, , binbyte
Close #FileNum
readBinFromFile = binbyte
Exit Function
errHandler:
Exit Function
End Function
把上面的代码编译成FileDownLoad.DLL,然后注册即可使用。我们要编写的ASP脚本代码如下: