• λ我爱Aspx >> C#.Net >> 利用FSO取得BMP,JPG,PNG,GIF文件信息
  • 利用FSO取得BMP,JPG,PNG,GIF文件信息

  • :aspxer  Դ:internet  :2007-5-12 7:50:55  ؼ:
  • <%

    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    '::: BMP, GIF, JPG and PNG :::

    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    '::: :::

    '::: This function gets a specified number of bytes from any :::

    '::: 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")

    ' First, 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

    Ҷƪл˵?
  • һƪ超长字符的智能分页-支持HTML
    һƪVBS、ASP代码语法加亮显示的类(2)