[DllImport("netapi32.dll", SetLastError=true, CharSet = CharSet.Unicode)]
static extern int NetFileClose(
string servername,
int id);
Declare Unicode Function NetFileClose Lib "netapi32.dll" _
ByVal servername As String, _
ByVal fileid As Integer) As Integer
None.
Definition from the API
'NET_API_STATUS NetFileClose(
' LPWSTR servername,
' DWORD fileid
');
See NetFileEnum for how to get the fileid
if (MessageBox.Show(this, "Are you sure you want to close this connection?" == DialogResult.Yes))
NetFileClose(strServerName, fileId);
If MsgBox("Are you sure you want to disconnect this resource?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
NetFileClose(strServerName, fileid)
End If
Do you know one? Please contribute it!