No se si nos entendemos bien, jajaja,
Private Sub Command1_Click()
Dim x
Text1.Text = ""
For x = 0 To File1.ListCount - 1
Text1.Text = Text1.Text & File1.List(x) & vbCrLf
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer
Dim Ruta As String
Dim t As Single
DoEvents
t = Timer
For i = 0 To File1.ListCount - 1
If File1.Selected(i) = True Then
If MsgBox("Estas seguro de eliminar " + File1.FileName + "?", vbQuestion + vbYesNo, "Eliminar Archivo") = vbYes Then
If Right(File1.Path, 1) <> "\" Then
Ruta = File1.Path & "\" & File1.FileName
Else
Ruta = File1.Path & File1.FileName
SetAttr Ruta, vbNormal
Kill Ruta
File1.Selected(i) = False
File1.Refresh
Exit For
End If
End If
End If
Next i
Label2.Caption = "Tiempo de eliminación en segundos = " & Format(Timer - t, "0.00")
End Sub
Private Sub Command3_Click()
Form2.Show
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Local Error Resume Next
Dir1.Path = Drive1.Drive
Select Case Err.Number
Case 0
'no hay error
Case 68
MsgBox "Error número " & Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Inserte disco"
Case Else
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Error"
End Select
On Local Error GoTo 0
End Sub
Private Sub File1_Click()
If Right(File1.Path, 1) <> "\" Then
Text1.Text = File1.FileName
Else
Text1.Text = File1.FileName
End If
End Sub
Private Sub Form_Load()
Dir1.Path = "c:\"
End Sub
Ese es mi codigo.
Private Sub Command1_Click()
Dim x
Text1.Text = ""
For x = 0 To File1.ListCount - 1
Text1.Text = Text1.Text & File1.List(x) & vbCrLf
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer
Dim Ruta As String
Dim t As Single
DoEvents
t = Timer
For i = 0 To File1.ListCount - 1
If File1.Selected(i) = True Then
If MsgBox("Estas seguro de eliminar " + File1.FileName + "?", vbQuestion + vbYesNo, "Eliminar Archivo") = vbYes Then
If Right(File1.Path, 1) <> "\" Then
Ruta = File1.Path & "\" & File1.FileName
Else
Ruta = File1.Path & File1.FileName
SetAttr Ruta, vbNormal
Kill Ruta
File1.Selected(i) = False
File1.Refresh
Exit For
End If
End If
End If
Next i
Label2.Caption = "Tiempo de eliminación en segundos = " & Format(Timer - t, "0.00")
End Sub
Private Sub Command3_Click()
Form2.Show
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Local Error Resume Next
Dir1.Path = Drive1.Drive
Select Case Err.Number
Case 0
'no hay error
Case 68
MsgBox "Error número " & Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Inserte disco"
Case Else
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Error"
End Select
On Local Error GoTo 0
End Sub
Private Sub File1_Click()
If Right(File1.Path, 1) <> "\" Then
Text1.Text = File1.FileName
Else
Text1.Text = File1.FileName
End If
End Sub
Private Sub Form_Load()
Dir1.Path = "c:\"
End Sub
Ese es mi codigo.