98、NT、2000下各有什么不同

解决方案 »

  1.   

    nt 我不清楚, 估计一样.
    98, 2000 都一样.
    在command line 键入 
    net use [drive:] [resource shared] *
      

  2.   

    shell "net use z:\\192.168.0.123 password"dir "Z:\"
      

  3.   

    若是从带有访问权限的网络文件夹 \\Server\Directory 中拷贝一个文件,那应该怎么做呢
      

  4.   

    用 shell "net use ..." 建立连接,如果连接成功的话,再用 filecopy 就行了
      

  5.   

    Public Declare Function GetDriveType Lib "Kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
    '映射一个网洛驱动器,并断开
    Public Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Long) As Long
    Public Declare Function WNetCancelConnection Lib "mpr.dll" Alias "WNetCancelConnectionA" (ByVal lpszName As String, ByVal bForce As Long) As Long
    Public Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
    检查连接》映射网络驱动器为本机盘》操作》关闭连接
      

  6.   

    Public Type NETRESOURCE
        dwScope As Long
        dwType As Long
        dwDisplayType As Long
        dwUsage As Long
        pLocalName As String
        pRemoteName As String
        pComment As Long
        pProvider As Long
        bIsConnect As Boolean
        strRomoteTop As String
        mbIsReady As Boolean
    End Type
    Public Function GetDriverName() As String
    On Error Resume NextDim i As Integer
    Dim strDriver As String
    For i = 0 To 25
        strDriver = Chr(98 + i)
        If GetDriveType(strDriver & ":\") = 3 Or GetDriveType(strDriver & ":\") = 5 Then
            GetDriverName = Chr(98 + i + 1) & ":"
        End If
        If GetDriveType(strDriver & ":\") = 4 Then
            If WNetCancelConnection(strDriver & ":", True) = 0 Then
            End If
        End If
    Next i
    If Asc(GetDriverName) = 123 Then
        MsgBox GetYhm(UserDlm) & ",对不起,您的计算机的盘符已经用完,系统无法映射,读取失败!"
    End IfEnd FunctionPublic Function ConnectServer() As Boolean
        ConnectServer = False
        
        If WNetAddConnection2(lpNet, strConnectPassWord, vbNull, 0) <> 0 Then
            If WNetAddConnection2(lpNet, strConnectPassWord, strConnectUserName, 0) <> 0 Then
                lpNet.bIsConnect = False
                MsgBox "网络连接错误,请检查网络连接状态!可能是您的电脑没有连入网络或网络配置错误."
                Exit Function
            Else
                ConnectServer = True
                lpNet.bIsConnect = True
            End If
        Else
            ConnectServer = True
            lpNet.bIsConnect = True
        End If
            
    End Function