• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    在asp文件中訪問flash詳細信息

    發布: 2007-7-14 19:37 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 14次 | 進入軟件測試論壇討論

    領測軟件測試網 <%

    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>"
    %>


    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>