联系站长 加入收藏 设为首页 繁體中文 RSS
  首页 | 生活百科 | 电脑网络 | 高手学堂 | 语录名言 | 读书文学 | 极品软件 | 奇趣图片 | 站长微博  
 您的位置: 精品百字节网 >> 电脑网络 >> 网络编程 >> 编程问题 >> 正文 当前没有通告!
   □  在asp文件中访问flash详细信息    3星级
在asp文件中访问flash详细信息
[ 作者:作者不详     来源:互连网     点击数:     更新时间:2006-12-24     文章录入:Admin
【字体:
[内容提要]
暂无简介
<%
  
  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>"
  %>
上一篇文章:用ASP实现在线压缩与解压缩 下一篇文章:COOKIE 学习
发表评论 □告诉好友 □打印此文 □收藏此页 □关闭窗口 □返回顶部
 最新热点文章
 精品医院类网站网址大收集
 如何删除windows 2003或xp系统隐藏的...
 DedeCms管理员后台登陆经常自动退出的...
 知道IP如何用dos命令查出电脑名称
 WORD出错老是要求以安全模式打开文件...
 如何设置首页不显示页眉页脚?
 如何利用inurl命令查询网站外链及栏目...
 
 最新推荐文章
 精品医院类网站网址大收集
 如何利用宽带路由器控制局域网内电脑上...
 CSS圆角代码的实现方法
 带停顿的单行文字滚动代码
 实用的新网站免费收录提交地址精选
 Left join , Right Join, Inner Join用...
 趣话淘宝网衍生的多种新型职业
 
 最新图文
  ◇  网友评论:(只显示最新5条。评论内容只代表网友观点,与本站立场无关!)
关于本站 | 免责申明 | 网站地图 | 联系站长 | 友情链接 | 与我同在
冀ICP备06032589号【虚拟化精英群虚拟化精英群续
  Copyright© 2006-2009 100byte.Com All Rights Reserved
网站声明:本网站是公益性质网站,部分内容来源于网络,如有侵犯您权利的地方,请与精品百字节站长联系,尽快修正.
Powered By CreateLive CMS 本站法律顾问:(冀港)武镇海律师
点击这里给我发消息