我爱Aspx >> C#.Net >> 利用FSO取得BMP,JPG,PNG,GIF文件信息<%
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: 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
Ҷƪл˵?
VBS、ASP代码语法加亮显示的类(2..[05-12]
Filter与updatebatch混合使用实现..[05-12]
如何正确显示数据库中的图片[05-12]
ASP 3.0高级编程(四)[05-12]
URL Moniker概述[05-12]
利用ADO进行MSSQL数据库操作[05-12]
JSP由浅入深(2)—— 第一个JSP[05-12]
实例学习PHP之投票程序篇[05-12]
ASP实用大全-ASP服务器组件(7)[05-12]
在Java中应用State设计模式(1)[05-12]