问题描述:
就是:a = InputBox("请输入要删除文件的所在磁盘", "请输入", "For example: C")
b = InputBox("请输入所在路径(除磁盘以外", "请输入", "For example: myfile/file.exe")
c = a + ":/" + b
Text1.Text = c
我想删除他输入的"C"所代表的数,应该怎样写?
解析:
首先说明下,路径用的是"\"而不是"/"
Private Sub Command1_Click()
a = InputBox("请输入要删除文件的所在磁盘", "请输入", "For example: C")
b = InputBox("请输入所在路径(除磁盘以外", "请输入", "For example: myfile\file.exe")
c = a + ":\" + b
Text1.Text = c
Kill c
End Sub
引用FSO(Microsoft Scripting Runtime),然后写出Dim FSO As New FileSystemObject
FSO.DeleteFolder ThePath 'ThePath即文件夹路径,而且不必先清空文件夹
或:(不必引用FSO)
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.DeleteFolder ThePath 'ThePath即文件夹路径,而且不必先清空文件夹
试一试
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)