使用Flash Player 6.0 r4版播放器的文件删去前424961个字节
使用Flash Player 7.0 r14版播放器的文件删去987137个字节
使用Flash Player 8.0 r22版播放器的文件1581057个字节
使用Flash Player 9.0 r45版播放器的文件2447561个字节
使用Flash Player 9.0 r115版播放器的文件3391489个字节
源代码如下:
Imports System Imports System.IO Public Class exe2swf Dim FPBB1 As Integer '定义一个变量用于保存Flash Player的版本 Private Sub ZH1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles ZH1.Click Dim MBWJ1 As String If MBWenJianLJ1.Text = "" Then '当目标文件路径未填写时 MBWJ1 = Mid(YWenJianLJ1.Text,1,YWenJianLJ1.Text.Length - 3) & "swf" '生成默认路径,即与源文件相同 Else MBWJ1 = MBWenJianLJ1.Text '否则则使用已填写的目标文件路径 End If If File.Exists(YWenJianLJ1.Text) = False Then '判断源文件是否存在 MsgBox("无法打开文件,可能源文件路径错误或不存在!",MsgBoxStyle.OkOnly,"打开文件错误") Else Select Case FPBB1 '使用Select函数分开处理不同版本的文件 Case 1 '使用Flash Player 6.0 r4版播放器的文件处理方法 Dim wjsj() As Byte FileOpen(1,YWenJianLJ1.Text,OpenMode.Binary) '打开源文件 ReDim wjsj(LOF(1) - 424961) '读取源文件 FileGet(1,wjsj,424961) FileClose(1) FileOpen(1,MBWJ1,OpenMode.Binary) '打开目标文件 FilePut(1,-1) '写入目标文件 FileClose(1) Case 2 '使用Flash Player 7.0 r14版播放器的文件处理方法 Dim wjsj() As Byte FileOpen(1,OpenMode.Binary) '打开源文件 ReDim wjsj(LOF(1) - 987137) '读取源文件 FileGet(1,987137) FileClose(1) FileOpen(1,-1) '写入目标文件 FileClose(1) Case 3 '使用Flash Player 8.0 r22版播放器的文件处理方法 Dim wjsj() As Byte FileOpen(1,OpenMode.Binary) '打开源文件 ReDim wjsj(LOF(1) - 1581057) '读取源文件 FileGet(1,1581057) FileClose(1) FileOpen(1,-1) '写入目标文件 FileClose(1) Case 4 '使用Flash Player 9.0 r45版播放器的文件处理方法 Dim wjsj() As Byte FileOpen(1,OpenMode.Binary) '打开源文件 ReDim wjsj(LOF(1) - 2447561) '读取源文件 FileGet(1,2447561) FileClose(1) FileOpen(1,-1) '写入目标文件 FileClose(1) Case 5 '使用Flash Player 9.0 r115版播放器的文件处理方法 Dim wjsj() As Byte FileOpen(1,OpenMode.Binary) '打开源文件 ReDim wjsj(LOF(1) - 3391489) '读取源文件 FileGet(1,3391489) FileClose(1) FileOpen(1,-1) '写入目标文件 FileClose(1) End Select MsgBox(YWenJianLJ1.Text & " 已经转换成功,并保存为 " & MBWJ1 & "!","转换成功") '以下If代码段用于在“转换完成后打开”选项勾选的情况下,打开生产的文件。 If WCDK1.Checked = True Then Process.Start(MBWJ1,-0) End If End If YWenJianLJ1.Text = "" '清除文本框 MBWenJianLJ1.Text = "" '清除文本框 ZH1.Enabled = False '禁用“转换”按钮 WCDK1.Checked = False '取消选择“转换完成后打开”选项 WCDK1.Enabled = False '令“转换完成后打开”选项不可用 DKWJ1.FileName = "" End Sub Private Sub LL1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles LL1.Click DKWJ1.ShowDialog() '显示打开文件对话框 YWenJianLJ1.Text = DKWJ1.FileName '将打开的文件的路径在源文件路径文本框中显示出来 End Sub Private Sub LL2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles LL2.Click BCWJ1.ShowDialog() '显示保存文件对话框 MBWenJianLJ1.Text = BCWJ1.FileName '将目标文件的路径在目标文件路径文本框中显示出来 End Sub Private Sub YWenJianLJ1_TextChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles YWenJianLJ1.TextChanged If YWenJianLJ1.Text = "" Then '如果“源文件路径”文本框为空,则三个单选按钮为未选状态且不可用 FP6.Checked = False FP7.Checked = False FP8.Checked = False FP91.Checked = False FP92.Checked = False FP6.Enabled = False FP7.Enabled = False FP8.Enabled = False FP91.Enabled = False FP92.Enabled = False Else '如果“源文件路径”文本框有内容,则三个单选按钮可用 FP6.Enabled = True FP7.Enabled = True FP8.Enabled = True FP91.Enabled = True FP92.Enabled = True End If End Sub Private Sub FP6_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles FP6.CheckedChanged If FP6.Checked = True Then ZH1.Enabled = True FPBB1 = 1 WCDK1.Enabled = True End If End Sub Private Sub FP7_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles FP7.CheckedChanged If FP7.Checked = True Then ZH1.Enabled = True FPBB1 = 2 WCDK1.Enabled = True End If End Sub Private Sub FP8_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles FP8.CheckedChanged If FP8.Checked = True Then '如果“Flash Player 8单选按钮”选择 ZH1.Enabled = True '“转换”按钮可用 FPBB1 = 3 '将值“1”赋给“Flash Player版本”变量 WCDK1.Enabled = True '“完成后打开”复选按钮可用 End If End Sub Private Sub FP91_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles FP91.CheckedChanged If FP91.Checked = True Then ZH1.Enabled = True FPBB1 = 4 WCDK1.Enabled = True End If End Sub Private Sub FP92_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles FP92.CheckedChanged If FP92.Checked = True Then ZH1.Enabled = True FPBB1 = 5 WCDK1.Enabled = True End If End Sub Private Sub About1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles About1.Click About.Show() End Sub Private Sub Help1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Help1.Click Help.Show() End Sub End Class
其它可电邮 wangjingkaibear@live.cn