public void Dispose() { try { if (rdpConnection != null && rdpConnection.Connected != 0) { rdpConnection.Disconnect(); } } catch (Exception ex) { Log.Debug(ex.ToString()); } if (rdpConnection != null) { rdpConnection.Dispose(); } rdpConnection = null; try { if (form != null) { form.Close(); } } catch (Exception ex) { Log.Debug(ex.ToString()); } if (form != null) { form.Dispose(); } form = null; }
public void Dispose() { try { if (rdpConnection != null) { rdpConnection.Disconnect(); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } if (rdpConnection != null) { rdpConnection.Dispose(); } rdpConnection = null; try { if (form != null) { form.Close(); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } if (form != null) { form.Dispose(); } form = null; }