Instructions: Copy the declarations and code below and paste directly into your VB project.
Private Declare Function WNetCancelConnection2 Lib "mpr.dll" _
Alias "WNetCancelConnection2A" (ByVal lpName As String, _
ByVal dwFlags As Long, ByVal fForce As Long) As Long
Private Const CONNECT_UPDATE_PROFILE = &H1