我有一个简单的方法将文件夹移动到新目录
Dim firstshare As String = "\\myshare\users\" & frmDeparture.txtUsername.Text
Dim destination As String = "\\secondshare\userarchives$\" & frmDeparture.txtUsername.Text
Try
If Directory.Exists(firstshare) Then
Directory.Move(firstshare, destination)
MsgBox("Folder moved from \\firstshare\users")
End If
Catch ex As Exception
MsgBox("Error finding folder")
End Try
如果我将“destination”设置为“\path\whatever”之类的路径,这可以正常工作,但如果它是隐藏路径(带有 $),则它不起作用。为了以编程方式访问隐藏的共享,我需要做些什么特别的事情吗?