如何用VB6制作光盘自启动程序!

类别:.NET开发 点击:0 评论:0 推荐:

打开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就可以刻进光盘了!

本文地址:http://com.8s8s.com/it/it44168.htm