首页 > 解决方案 > VB.NET 如何删除便携式设备中存在的文件夹

问题描述

我已使用 Shell32.Shell 将文件夹从我的计算机复制到便携式设备

Dim SrcPath = "my path"
Dim tmpShell As Shell
Dim tmpFolder As Folder
Dim destinationPath As String

destinationPath = "destinationpath here"
' destinationPath  = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_05c6&pid_9039&mi_00#7&105d921&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,11280285696}\{00000056-0001-0001-0000-000000000000}"

' because it is coming from tmpShell.BrowseForFolder in another function

tmpShell = New Shell

tmpFolder = tmpShell.NameSpace(destinationPath)
tmpFolder.CopyHere(SrcPath)

现在没问题,但我想删除这个文件夹' ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\?\usb#vid_05c6&pid_9039&mi_00#7&105d921&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d43 {10001,,11280285696}{00000056-0001-0001-0000-000000000000} '。

路径是使用以下方法获得的:

Dim tmpShell As New Shell
Dim tmpFolder As Folder
tmpFolder = tmpShell.BrowseForFolder(0, "Choose the device iternal storage folder", 0, 0)
dim the path = tmpFolder.Items.Item.Path

我无法使用

IO.File.Delete()

请帮忙

标签: vb.netdelete-operator

解决方案


推荐阅读