FSO Get image File information

Source: Internet
Author: User
Tags numeric value

<%
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: BMP, GIF, JPG and PNG:::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: :::
':: This function gets a specified number of bytes from::
'::: File, starting at the offset (base 1):::
'::: :::
'::: Passed::::
'::: flnm => filespec of file to read:::
'::: Offset => offset at which to start reading:::
'::: bytes => How many bytes to read::
'::: :::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function GetBytes (flnm, offset, bytes)
Dim objFSO
Dim objftemp
Dim objTextStream
Dim lngsize
On Error Resume Next
Set objFSO = CreateObject ("Scripting.FileSystemObject")
' We get the FileSize
Set objftemp = Objfso.getfile (FLNM)
Lngsize = Objftemp.size
Set objftemp = Nothing
fsoforreading = 1
Set objTextStream = objFSO.OpenTextFile (flnm, fsoforreading)
If offset > 0 Then
Strbuff = Objtextstream.read (offset-1)
End If
If bytes =-1 Then ' Get all!
GetBytes = Objtextstream.read (lngsize) ' ReadAll
Else
GetBytes = Objtextstream.read (bytes)
End If
Objtextstream.close
Set objTextStream = Nothing
Set objFSO = Nothing
End Function
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: :::
':: Functions to convert two bytes to a numeric value (long)::
'::: (both Little-endian and Big-endian):::

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.