-
asp.net教程之在asp文件中访问flash详细信息
作者: 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>"
%>
<%
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>"
%>
栏目列表
最新更新
nodejs爬虫
Python正则表达式完全指南
爬取豆瓣Top250图书数据
shp 地图文件批量添加字段
爬虫小试牛刀(爬取学校通知公告)
【python基础】函数-初识函数
【python基础】函数-返回值
HTTP请求:requests模块基础使用必知必会
Python初学者友好丨详解参数传递类型
如何有效管理爬虫流量?
SQL SERVER中递归
2个场景实例讲解GaussDB(DWS)基表统计信息估
常用的 SQL Server 关键字及其含义
动手分析SQL Server中的事务中使用的锁
openGauss内核分析:SQL by pass & 经典执行
一招教你如何高效批量导入与更新数据
天天写SQL,这些神奇的特性你知道吗?
openGauss内核分析:执行计划生成
[IM002]Navicat ODBC驱动器管理器 未发现数据
初入Sql Server 之 存储过程的简单使用
这是目前我见过最好的跨域解决方案!
减少回流与重绘
减少回流与重绘
如何使用KrpanoToolJS在浏览器切图
performance.now() 与 Date.now() 对比
一款纯 JS 实现的轻量化图片编辑器
关于开发 VS Code 插件遇到的 workbench.scm.
前端设计模式——观察者模式
前端设计模式——中介者模式
创建型-原型模式