不知道我上传的能不能看见
代码如下
Private Sub Command1_Click()
Dim caseIndex%, i%
If Text1 <> "" Then caseIndex = 1
If Text2 <> "" Then caseIndex = 2
If Text3 <> "" Then caseIndex = 3
'保存File1中的内容到List1中
List1.Clear
For i = 0 To File1.ListCount - 1
List1.AddItem File1.List(i)
Next i
'准备改名
ChDrive Drive1.Drive
ChDir Dir1.Path
Select Case caseIndex
Case 1
For i = 0 To File1.ListCount - 1
Name File1.List(i) As Text1 & File1.List(i)
Next i
File1.Refresh
Case 2
For i = 0 To File1.ListCount - 1
Name File1.List(i) As Right(File1.List(i), Len(File1.List(i)) - Val(Text2))
Next i
File1.Refresh
Case 3
For i = 0 To File1.ListCount - 1
Name File1.List(i) As Format(i + 1, String(Val(Text3), "0")) & File1.List(i)
Next i
File1.Refresh
End Select
End Sub
Private Sub Command2_Click()
For i = 0 To File1.ListCount - 1
Name File1.List(i) As List1.List(i)
Next i
File1.Refresh
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub