分享
 
 
 

在asp文件中访问flash详细信息

王朝asp·作者佚名  2006-12-16
窄屏简体版  字體: |||超大  

作者: chenyangasp

<%

Class SWFDump

Private header

Private RECTdata

Private nBits

Private mversion

Private mfilelen

Private mxMin

Private mxMax

Private myMin

Private myMax

Private mheigt

Private mwidth

Private mframerate

Private mframecount

Private Sub Class_Initialize()

End Sub

Private Sub Class_Terminate()

End Sub

Private Function ReadHeader (filename)

Const ForReading = 1, ForWriting = 2, ForAppending = 8

Dim fso, f

Set fso = CreateObject("Scripting.FileSystemObject")

Set f = fso.OpenTextFile(filename, ForReading)

ReadHeader = f.Read(21)

End Function

Private Function ToBin(inNumber, OutLenStr )

Dim binary

binary = ""

do while inNumber >= 1

binary = binary & inNumber mod 2

inNumber = inNumber \ 2

loop

binary = binary & String(OutLenStr - len(binary), "0")

ToBin = StrReverse(binary)

End Function

Private Function Bin2Decimal(inBin)

Dim counter

Dim temp

Dim Value

inBin = StrReverse(inBin)

temp = 0

For counter = 1 to Len(inBin)

If counter = 1 then

Value = 1

Else

Value = Value * 2

End If

temp = temp + mid(inBin, counter ,1) * Value

Next

Bin2Decimal = temp

End Function

Public Function SWFDump(fileName)

header = ReadHeader (fileName)

mversion = asc(mid(header,4,1))

mfilelen = asc(mid(header,5,1))

mfilelen = mfilelen + asc(mid(header,6,1)) * 256

mfilelen = mfilelen + asc(mid(header,7,1)) * 256 * 256

mfilelen = mfilelen + asc(mid(header,8,1)) * 256 * 256 * 256

RECTdata = ToBin(asc(mid(header,9,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,10,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,11,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,12,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,13,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,14,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,15,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,16,1)),8)

RECTdata = RECTdata & ToBin(asc(mid(header,17,1)),8)

nBits = Mid(RECTdata,1,5)

nBits = Bin2Decimal(nBits)

mxMin = Bin2Decimal(Mid(RECTdata,6,nBits))

mxMax = Bin2Decimal(Mid(RECTdata,6 + nBits * 1 ,nBits))

myMin = Bin2Decimal(Mid(RECTdata,6 + nBits * 2 ,nBits))

myMax = Bin2Decimal(Mid(RECTdata,6 + nBits * 3 ,nBits))

mheigt = (myMax - myMin) / 20

mwidth = (mxMax - mxMin) / 20

mframerate = asc(mid(header,18,1))

mframecount = asc(mid(header,19,1))

mframecount = mframecount + asc(mid(header,20,1)) * 256

End Function

Public Property Get Heigt()

Heigt = mheigt

End Property

Public Property Get Width()

Width = mwidth

End Property

Public Property Get Version()

Version = mversion

End Property

Public Property Get FileLen()

FileLen = mfilelen

End Property

Public Property Get xMin()

xMin = mxMin

End Property

Public Property Get xMax()

xMax = mxMax

End Property

Public Property Get yMin()

yMin = myMin

End Property

Public Property Get yMax()

yMax = myMax

End Property

Public Property Get Framerate()

Framerate = mframerate

End Property

Public Property Get Framecount()

Framecount = mframecount

End Property

End Class

%>

做成包含文件swfheaderdump.inc

调用:

<!-- #include file="swfheaderdump.inc" -->

<%

' Pass the SWF name in querystring this way

' swfdump.asp?swf=yourmovie.swf

set myObj = new swfdump

myObj.SWFDump (Server.MapPath(request("swf")))

Response.Write "Heigt (pixel) = " & myObj.Heigt & "<br>"

Response.Write "Width (pixel) = " & myObj.Width & "<br>"

Response.Write "Version = " & myObj.Version & "<br>"

Response.Write "FileLen (bytes) = " & myObj.FileLen & "<br>"

Response.Write "xMin (twips) = " & myObj.xMin & "<br>"

Response.Write "xMax (twips) = " & myObj.xMax & "<br>"

Response.Write "yMin (twips) = " & myObj.yMin & "<br>"

Response.Write "yMax (twips) = " & myObj.yMax & "<br>"

Response.Write "FrameRate = " & myObj.FrameRate & "<br>"

Response.Write "FrameCount = " & myObj.FrameCount & "<br>"

%>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有