DirectoryInfo.Exists使用UNC路径返回false

时间:2013-03-27 17:03:53

标签: vb.net dns directory tablet unc

好吧,我的应用程序位于非域名平板电脑上。

启动时,应用程序shell命令对网络路径

进行适当的信任
Shell("net use \\mypath\destloca password username")

这个命令是正确的,并按照它的意思行事。

接下来,我致电

 Dim dir As New IO.DirectoryInfo(loca)

 If Not dir.Exists Then
        MessageBox.Show("There are no records for loca", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
        Exit Sub
    End If

这通常可以正常工作,但每隔一段时间它就会返回false。网络已连接,但我无法访问域资源。

然而,在我再次使用Shell之后,我能够访问UNC路径。

有人有任何想法吗?

0 个答案:

没有答案