Rede - abrir a caixa de dialogo do windows para conectar ou desconectar a rede

Top  Previous  Next

function ConnectNetwork: Boolean;

begin

  Result := WNetConnectionDialog(Application.Handle, RESOURCETYPE_DISK) = NO_ERROR;

end;

 

function DisconnectNetwork: Boolean;

begin

  Result := WNetDisconnectDialog(Application.Handle, RESOURCETYPE_DISK) = NO_ERROR;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  DisConnectNetwork;

end;

.