VB 版 (精华区)
发信人: happyok (好高兴,好高兴), 信区: VB
标 题: 软盘到软盘拷贝
发信站: 哈工大紫丁香 (2000年07月16日11:15:54 星期天), 转信
'说明:表单一个;命令按钮一个为CmdCopyDisk;驱动器列表控件一个为Drive1
Option Explicit
Private Declare Function GetDriveType Lib "kernel32" Alias _
"GetDriveTypeA" (ByVal nDrive As String) As Long
Private Sub cmdCopyDisk_Click()
Dim DriveLetter$, DriveNumber&, DriveType&
Dim RetVal&, RetFromMsg&
DriveLetter = UCase(Drive1.Drive) '驱动器列表控件
DriveNumber = (Asc(DriveLetter) - 65)
DriveType = GetDriveType(DriveLetter)
If DriveType = 2 Then '仅适用于软盘
RetVal = Shell("rundll32.exe diskcopy.dll,DiskCopyRunDll " _
& DriveNumber & "," & DriveNumber, 1)
Else
RetFromMsg = MsgBox("仅能拷贝软盘! " & vbCrLf & "请更换磁盘后,再尝试。 ", 6
4, "拷贝错误")
End If
End Sub
--
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.97.206.203]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.169毫秒