欢迎来到天天文库
浏览记录
ID:9703844
大小:67.50 KB
页数:7页
时间:2018-05-05
《利用fso取得bmp,jpg,png,gif文件信息》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、利用FSO取得BMP,JPG,PNG,GIF文件信息>>教育资源库<%’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::’:::BMP,GIF,JPGandPNG:::’:::::::::::::::::::::::::::::::::::::::::::::::::::::::
2、::::::::::::’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::’::::::’:::Thisfunctiongetsaspecifiednumberofbytesfromany:::’:::file,startingattheoffset(base1):::’::::::’:::Passed::::’:::flnm=>Filespecoffiletoread:::’:::offset=>Offs
3、etatanybytestoread:::’::::::’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::functionGetBytes(flnm,offset,bytes)DimobjFSODimobjFTempDimobjTextStreamDimlngSizeonerrorresumenextSetobjFSO=CreateObject("Scripting.FileSystemObject")’First,p
4、=objFSO.GetFile(flnm)lngSize=objFTemp.SizesetobjFTemp=nothingfsoForReading=1SetobjTextStream=objFSO.OpenTextFile(flnm,fsoForReading)ifoffset>0thenstrBuff=objTextStream.Read(offset-1)endififbytes=-1then’GetAll!GetBytes=objTextStream.Read(lngSize)’ReadA
5、llelseGetBytes=objTextStream.Read(bytes)endifobjTextStream.ClosesetobjTextStream=nothingsetobjFSO=nothingendfunction’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::’::::::’:::Functionstoconverttericvalue(long):::’:::(bothlittle-endian
6、andbig-endian):::’::::::’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::functionlngConvert(strTemp)lngConvert=clng(asc(left(strTemp,1))+((asc(right(strTemp,1))*256)))endfunctionfunctionlngConvert2(strTemp)lngConvert2=&1234下一页>>>>这篇文章来
7、自..,。nbsp;clng(asc(right(strTemp,1))+((asc(left(strTemp,1))*256)))endfunction’:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::’::::::’:::Thisfunctiondoesmostoftherealpt:::’:::toreadanyfile,regardlessoftheextension,andage.:::’::::::’:::
8、Passed::::’:::flnm=>Filespecoffiletoread:::’:::age:::’:::height=>heightofimage:::’:::depth=>colordepth(innumberofcolors):::’:::strImageType=>typeofimage(e.g.GIF,BMP,etc.):::’::::::’:::::::::::::::::::::::::::::
此文档下载收益归作者所有