打印本文 打印本文 关闭窗口 关闭窗口
如何用VB6制作光盘自启动程序!
作者:武汉SEO闵涛  文章来源:敏韬网  点击数701  更新时间:2009/4/23 15:43:39  文章录入:mintao  责任编辑:mintao

打开VB6建立一个窗体,代码如下:

Private Sub Label1_Click(Index As Integer)
On Error GoTo exit_err
strPath = App.Path
If Right(strPath, 1) <> "\" Then strPath = strPath & "\"
    Select Case Index
        Case 0
            Shell "NotePad.EXE " & strPath & "readme.txt", 3     ''''打开安装帮助的文本文件
        Case 1
            Shell "explorer.exe " & strPath, 3                                ''''浏览目录
        Case 2
            Shell strPath & "sql2000\autorun.exe"                          ''''安装SQLserver 20000
        Case 3
            Shell strPath & "EtoERP\亿图ERP.exe"                      ''''安装ERP系统Server
        Case 4
            End                                                                             ''''退出
    End Select
    Exit Sub
exit_err:
    MsgBox "找不到文件!        ", 48
End Sub

Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1(Index).ForeColor = &HFF&
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim i As Integer
    For i = 0 To Label1.Count - 1
      Label1(i).ForeColor = &H80000009
    Next i
End Sub

其中,label1有5个索引,功能注释中说明了!最后生成AutoRun.exe就可以刻进光盘了!

打印本文 打印本文 关闭窗口 关闭窗口