日期:2014-05-17  浏览次数:21016 次

如何判断另一台电脑上是否存在某个文件路径
比如另一台电脑B和我是同一个局域网里面的,有个路径,路径为“C:\windows\Example”,我应该如何判断该路径是否在B电脑中存在呢?

------解决方案--------------------
Directory.Exists(@"C:\windows\Example");
------解决方案--------------------
直接判断貌似没这可能,看看c的

If IO.File.Exists(SKYTemplateFile) = False Then
                   ‘文件不存在
                    If SKYTemplatePath.IndexOf("\\") = 0 Then
                        If Connect(SKYTemplatePath, lpRemoteUsr, lpRemotePass) = False Then
                            ShowMsgBox("...")
                            Return False
                        ElseIf IO.File.Exists(SKYTemplateFile) = False then
                                ShowMsgBox("...")
                                Return False 
                        End If
                    Else
                        ShowMsgBox("...")
                        Return False