private void RemoteDesktopTabPageView_Shown(object sender, EventArgs e) { //Verbinden rdp.Connect(); LOG.StoreRdpLogMessage("Rdp-ActiveX-Control: Start connection to '" + m_host + "'"); DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Start connection to '" + m_host + "'"); }
public RemoteDesktopTabPageView(string host, string username, string password, string domain = "") { InitializeComponent(); //Variablen für spätere Reconnects zwischenspeichern m_host = host; m_username = username; m_password = password; m_domain = domain; DEBUG.ShowMessageInConsole("Storing Connection-Information - Host: " + host + "|Username: "******"|Domain: " + domain + "|Password: "******"Verbindung mit " + ((char)34) + host + ((char)34); //RDP-Control einstellen rdp.Server = host; rdp.UserName = username; rdp.Domain = domain; //Settings für das Control rdp.ColorDepth = 32; rdp.AdvancedSettings9.ClearTextPassword = password; rdp.AdvancedSettings9.EnableAutoReconnect = true; rdp.AdvancedSettings9.EnableCredSspSupport = true; //Für Network Layer Authentification notwendig rdp.AdvancedSettings9.GrabFocusOnConnect = true; rdp.AdvancedSettings9.DisplayConnectionBar = true; rdp.AdvancedSettings9.EnableWindowsKey = 1; rdp.AdvancedSettings9.allowBackgroundInput = 1; rdp.AdvancedSettings2.AcceleratorPassthrough = -1; rdp.AdvancedSettings9.BitmapPeristence = 1; rdp.AdvancedSettings9.Compress = 1; rdp.AdvancedSettings9.DoubleClickDetect = 1; rdp.AdvancedSettings9.SmartSizing = false; rdp.AdvancedSettings2.DisableCtrlAltDel = -1; }
/// <summary> /// Event-Methode: /// Wenn die Anmeldung erfolgreich war /// </summary> private void rdp_OnLoginComplete(object sender, EventArgs e) { LOG.StoreRdpLogMessage("Rdp-ActiveX-Control: Login with '" + m_host + "' has been succeed"); if (m_domain == "") { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Login with '" + m_host + "' has been succeed - Username: "******"\" + m_username); } else { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Login with '" + m_host + "' has been succeed - Username: "******"\" + m_username); } }
/// <summary> /// Event-Methode: /// Wenn die Verbindung getrennt wurde /// </summary> private void rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e) { LOG.StoreRdpLogMessage("Rdp-ActiveX-Control: Disconnected from host '" + m_host + "'"); DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Disconnected from host '" + m_host + "' - Disconnect-Code: " + e.discReason.ToString()); //Wenn m_isreconnecting false ist, dann dies ausführen if (!m_isreconnecting) { //Zwingt die TabPage, zu verschwinden base.Parent.Dispose(); } }
/// <summary> /// Event-Methode: /// Wenn sich das Netzwerk geändert hat /// </summary> private void rdp_OnNetworkStatusChanged(object sender, AxMSTSCLib.IMsTscAxEvents_OnNetworkStatusChangedEvent e) { //Werte darstellen switch (e.qualityLevel) //Quality-Level { case 0: tsbtnconnectionqualitiy.Image = global::RemoteDesktopManager.Properties.Resources.icon_rdpquality_level0; break; case 1: tsbtnconnectionqualitiy.Image = global::RemoteDesktopManager.Properties.Resources.icon_rdpquality_level1; break; case 2: tsbtnconnectionqualitiy.Image = global::RemoteDesktopManager.Properties.Resources.icon_rdpquality_level2; break; case 3: tsbtnconnectionqualitiy.Image = global::RemoteDesktopManager.Properties.Resources.icon_rdpquality_level3; break; case 4: tsbtnconnectionqualitiy.Image = global::RemoteDesktopManager.Properties.Resources.icon_rdpquality_level4; break; } m_rdpquality = (int)e.qualityLevel; //Level zwischenspeichern tslbbandwidth.Text = (e.bandwidth / 1024).ToString() + " KBit/s"; tslbping.Text = e.rtt.ToString(); //Debug-Log anzeigen DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: The Network-State has been changed - Quality-Level: " + e.qualityLevel.ToString() + "| Bandwidth: " + e.bandwidth.ToString() + "|Ping: " + e.rtt.ToString()); }
/// <summary> /// Event-Methode: /// Wenn eine Nachricht empfangen wurde vom Service (Dienst) /// </summary> private void rdp_OnServiceMessageReceived(object sender, AxMSTSCLib.IMsTscAxEvents_OnServiceMessageReceivedEvent e) { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: A ServiceMessage has been received - Message: " + e.serviceMessage); }
/// <summary> /// Event-Methode: /// Wenn der öffentliche Schlüssel empfangen wurde /// </summary> private bool rdp_OnReceivedTSPublicKey(object sender, AxMSTSCLib.IMsTscAxEvents_OnReceivedTSPublicKeyEvent e) { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: TSPublicKey received - PublicKey: " + e.publicKey); return(true); }
/// <summary> /// Event-Methode: /// Wenn sich der Client automatisch neu verbunden hat /// </summary> private void rdp_OnAutoReconnected(object sender, EventArgs e) { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: The RdpClient has automatically reconnected"); }
/// <summary> /// Event-Methode: /// Wenn eine Warnung bei der Anmeldung angezeigt wird /// </summary> private void rdp_OnAuthenticationWarningDisplayed(object sender, EventArgs e) { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: A warning at the login has been displayed", DEBUG.DebugMessageType.Warning); }
/// <summary> /// Event-Methode: /// Wenn sich die Auflösung des RemoteDesktops verändert hat /// </summary> private void rdp_OnRemoteDesktopSizeChange(object sender, AxMSTSCLib.IMsTscAxEvents_OnRemoteDesktopSizeChangeEvent e) { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: The RemoteDesktop-Size has been changed - New Resolution: " + e.width.ToString() + "x" + e.height.ToString()); }
/// <summary> /// Event-Methode: /// Wenn ein Problem bei der Anmeldung aufgetreten ist /// </summary> private void rdp_OnLogonError(object sender, AxMSTSCLib.IMsTscAxEvents_OnLogonErrorEvent e) { LOG.StoreErrorRdpLogMessage("Rdp-ActiveX-Control: A LoginError has been appeared - Error-Code: " + e.lError.ToString()); DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: A LoginError has been appeared - Error-Code: " + e.lError.ToString(), DEBUG.DebugMessageType.Error); }
/// <summary> /// Event-Methode: /// Wenn eine Warnung aufgetreten ist /// </summary> private void rdp_OnWarning(object sender, AxMSTSCLib.IMsTscAxEvents_OnWarningEvent e) { LOG.StoreWarningRdpLogMessage("Rdp-ActiveX-Control: A Warning has been appeared - Warning-Code: " + e.warningCode.ToString()); DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: A Warning has been appeared - Warning-Code: " + e.warningCode.ToString(), DEBUG.DebugMessageType.Warning); }
/// <summary> /// Event-Methode: /// Wenn eine Verbindung hergestellt wird /// </summary> private void rdp_OnConnecting(object sender, EventArgs e) { DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Connecting to host"); }
/// <summary> /// Event-Methode: /// Wenn die Verbindung hergestellt wurde /// </summary> private void rdp_OnConnected(object sender, EventArgs e) { LOG.StoreRdpLogMessage("Rdp-ActiveX-Control: Connected to host '" + m_host + "'"); DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Connected to host '" + m_host + "'"); }