我想访问网络上的另外一台计算机,并且执行上面的文件。如何实现

解决方案 »

  1.   

    判断网络路径是否存在
    Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
    Function NetPathExist(NetPath As String) As Boolean
    Dim Resu As Long
    Resu = WNetAddConnection(NetPath, vbNullString, "")
    If Resu = 0 Then
        NetPathExist = True
    Else
        NetPathExist = False
    End If
    End Function
    访问网络路径上文件
    Function OpenFile(NetPath As String)
    Dim fs As New FileSystemObject
    fs.GetFile(NetPath)
    End Function