.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
EXE2SWF(SourceCode)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

由于以前写过个播放器,硬盘里也放着不少Flash文件,不少是EXE格式的.
也下载过一些小程序转换,现在闲着没事,自己也写了一个小程序...但....

'''''函数功能:输入SWF或EXE格式的Flash文件
Private Sub OutputFlash(InputFile As String,  Outputfile As String)
   Dim bittmp() As Byte
    Dim FileLenth&, I&, J&
    Dim FileNum1 As Integer
    Dim FileNum2 As Integer
    Dim strFwsFlag As String
    Dim strHexFlag As String
    Dim strVAR As String
    Dim bitVAR As Byte
    Dim swfSize As Long
    Dim swfStartPostion As Long
  
   FileLenth = FileLen(InputFile)
    S = "&H"
   FileNum1 = FreeFile: Open InputFile For Binary As #FileNum1
   FileNum2 = FreeFile: Open Outputfile For Binary As #FileNum2
  
   Dim sss$: sss = Time
         For I = FileLenth To FileLenth - 3 Step -1
             Seek #FileNum1, I                                    '''文件指针位置
             t = AscB(StrConv((Input(1, #FileNum1)), 128))        '''字符串ASCII码
             s = s & Hex(Int(t / 16)) & Hex(Int(t Mod 16))      '''双字16进制
         Next
         sss = sss & ">" & Time '''Record TIME
        
             swfSize = Val(s)                                           '''SWF文件大小
             swfStartPostion = FileLenth - swfSize - 7         ''SWF文件开始地址
            Seek #FileNum1, swfStartPostion
            strVAR = Asc(Input(3, #FileNum1))
            If strVAR = 70 Or strVAR = 67 Then                                 '''正确查找到FWS标记
                           Dim startByte&: startByte = swfStartPostion
                              sss = sss & ">" & Time
                             
                              ReDim bittmp(swfSize) As Byte
                              For I = 1 To swfSize
                                 Get #FileNum1, swfStartPostion + I - 1, bittmp(I)
                              Next
                              For I = 1 To swfSize            '''输出SWF格式的文件
                                 Put #FileNum2, I, bittmp(I)
                              Next                                                                                   
                           sss = sss & ">" & Time   ''Record TIME
                     Close #FileNum2
                     Skf.Movie = Outputfile
            Else
                     MnuShowText.Caption = "Sorry! Can't Output SWF-Flash File"
                     tmr = True
            End If
    Close #FileNum1
    sss = sss & ">" & Time ''Show Time
    Me.Caption = sss
End Sub

每次写文件,读文件都是一个一个字节读写.所以速度很慢!




相关文章

相关软件