[DllImport("mpr.dll")]
static extern int WNetCancelConnection2(string lpName, Int32 dwFlags, bool bForce);
Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias "WNetCancelConnection2A" (ByVal lpName As String, ByVal dwFlags As Long, ByVal fForce As Long) As Long
<DllImport("mpr.dll")> _
Shared Function WNetCancelConnection2(ByVal lpName As String, ByVal dwFlags As Long, ByVal fForce As Long) As Long
End Function
None.
The system updates the user profile with the information that the connection is no longer a persistent one if you pass this constant as <dwFlags>
private const int CONNECT_UPDATE_PROFILE = 0x1;
[DllImport("mpr.dll")]
public static extern int WNetCancelConnection2(string lpName, Int32 dwFlags, bool fForce);
private const int CONNECT_UPDATE_PROFILE = 0x1;
private const int NO_ERROR = 0;
int result=WNetCancelConnection2("Y:", CONNECT_UPDATE_PROFILE, true);
if (result != NO_ERROR) {
//handle error
}
Do you know one? Please contribute it!