1. 首页
  2. 编程语言
  3. VB
  4. 删除文件到回收站程序(VB6.0源代码编写)Private Sub Command1_Click()

删除文件到回收站程序(VB6.0源代码编写)Private Sub Command1_Click()

上传者: 2018-12-27 05:46:48上传 RAR文件 8.94KB 热度 27次
删除文件到回收站程序(VB6.0源代码编写)Private Sub Command1_Click() Dim fileop As SHFILEOPSTRUCT Dim aFileOp() As Byte, nLenStruct& With fileop .hWnd = Me.hWnd .wFunc = FO_COPY .pFrom = txFrom & vbNullChar & vbNullChar sLastCopyDir = txTo .pTo = txTo & vbNullChar & vbNullChar .fFlags = FOF_CREATEPROGRESSDLG Or FOF_FILESONLY End With Dim DelFileOp As SHFILEOPSTRUCT With DelFileOp .hWnd = Me.hWnd .wFunc = FO_DELETE If (txTo sLastCopyDir) And (sLastCopyDir "& quot;) Then _ If MsgBox("You are about to send files othere than the ones that " & _ "you just copied to the Recycle Bin." & vbCrLf & vbCrLf & _ "Continue Operation?", vbYesNoCancel) 6 Then Exit Sub sLastCopyDir = Dir1.Path & "\" & File1.FileName If (Right$(sLastCopyDir, 1) "\") And _ (Right$(sLastCopyDir, 4) "\*.*") Then sLastCopyDir = sLastCopyDir & "\" If (Right$(sLastCopyDir, 3) "*.*") Then sLastCopyDir = sLastCopyDir & "*.*" .pFrom = sLastCopyDir & vbNullChar & vbNullChar .fFlags = FOF_ALLOWUNDO End With If SHFileOperation(DelFileOp) Then ' MsgBox Err.LastDllError Else If DelFileOp.fAnyOperationsAborted Then MsgBox "Operation Aborted" End If End Sub quot;) Then _ If MsgBox("You are about to send files othere than the ones that " & _ "you just copied to the Recycle Bin." & vbCrLf & vbCrLf & _ "Continue Operation?", vbYesNoCancel) 6 Then Exit Sub sLastCopyDir = Dir1.Path & "\" & File1.FileName If (Right$(sLastCopyDir, 1) "\") And _ (Right$(sLastCopyDir, 4) "\*.*") Then sLastCopyDir = sLastCopyDir & "\" If (Right$(sLastCopyDir, 3) "*.*") Then sLastCopyDir = sLastCopyDir & "*.*" .pFrom = sLastCopyDir & vbNullChar & vbNullChar .fFlags = FOF_ALLOWUNDO End With If SHFileOperation(DelFileOp) Then ' MsgBox Err.LastDllError Else If DelFileOp.fAnyOperationsAborted Then MsgBox "Operation Aborted" End If End Sub
下载地址
用户评论