📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Public CdromName As String
Public BackupFileArray() As String
Public RestoreFile() As String
Public Info As String
Public Sub CencerForm(fForm As Form)
fForm.Move (Screen.Width - fForm.Width) / 2, (Screen.Height - fForm.Height) / 2
End Sub
Public Sub GetFoldersAndFiles(Foldername As String)
Dim fso As New Scripting.FileSystemObject
Dim fd As Folder, sfd As Folder, fs As File
Set fd = fso.GetFolder(Foldername)
For Each sfd In fd.SubFolders
MainForm.TreeView2.Nodes.Add Foldername, tvwChild, sfd.Path + "\", sfd.Name, 3, 2
AddCdrom.Label3.Caption = sfd.Path
GetFoldersAndFiles sfd.Path + "\"
Next
For Each fs In fd.Files
MainForm.TreeView2.Nodes.Add Foldername, tvwChild, fs.Path, fs.Name, 10
AddCdrom.Label3.Caption = fs.Path
Next
End Sub
Public Sub main()
If Dir("cdrom.cds") = "" Then
MsgBox "光盘镜像注册表丢失,请重装系统!", vbCritical
End
End If
If App.PrevInstance Then
MsgBox "光盘管家已经被启动,无须再开启了!", vbCritical
End
Else
Load MainForm
MainForm.Show
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -