Discocnnect the network drive : Network drive « Windows « VB.Net Tutorial






Imports System.Runtime.InteropServices

Public Class GetPrinterPort
      Const RESOURCETYPE_DISK As Short = 1
      Const RESOURCETYPE_PRINTER As Short = 2
    
      Private Declare Function WNetDisconnectDialog Lib "mpr.dll" (ByVal hwnd As Integer, ByVal dwType As Integer) As Integer


    Public Shared Sub Main
         Dim dwResult As Integer

        'Discocnnect the network drive {RESOURCETYPE_DISK = 1}
        dwResult = WNetDisconnectDialog(0, RESOURCETYPE_DISK)
    
    End Sub
End Class








24.6.Network drive
24.6.1.Connect to network driveConnect to network drive
24.6.2.Discocnnect the network drive