掌握一些WEB开发特技

ZDNet软件频道 时间:2002-11-20 作者:BUILDER.COM |  我要评论()
本文关键词:
代码1
Public Function GetImageFile(ByVal sFileName As Variant, _
ByRef ImageData As Variant, ByRef DataLength As Variant) As Boolean

On Error GoTo ErrHandler
Dim bData() As Byte
Dim lFilSize As Long

Open sFileName For Binary Access Read As #1

lFilSize = LOF(1)

ReDim bData(lFilSize) As Byte

Dim i As Integer
i = 0
While i <= lFilSize
Get #1, i + 1, bData(i)
i = i + 1
Wend

ImageData = bData()
DataLength = lFilSize

GetImageFile = True

ExitCall:
Close #1
Exit Function
ErrHandler:
'Log error here.
GoTo ExitCall
End Function 

百度大联盟认证黄金会员Copyright© 1997- CNET Networks 版权所有。 ZDNet 是CNET Networks公司注册服务商标。
中华人民共和国电信与信息服务业务经营许可证编号:京ICP证010391号 京ICP备09041801号-159
京公网安备:1101082134