public static void RemoteConnect(MSTSCConfig cfg) { AxMSTSCLib.AxMsRdpClient4 rdpc = new AxMSTSCLib.AxMsRdpClient4(); rdpc.UserName = cfg.usrname; rdpc.AdvancedSettings2.ClearTextPassword = cfg.password; rdpc.Server = cfg.ServerIP; rdpc.AdvancedSettings2.RDPPort = int.Parse(cfg.PortNum); rdpc.Domain = "."; rdpc.Connect(); //////AxMSTSCLib.AxMsTscAxNotSafeForScripting remoteserver = new AxMSTSCLib.AxMsTscAxNotSafeForScripting(); //////// //////// RDP //////// //////remoteserver.UserName = cfg.usrname; //////remoteserver.Server = cfg.ServerIP; //////remoteserver.SecuredSettings.FullScreen = 1; //////remoteserver.AdvancedSettings.Compress = 1; //////MSTSCLib.IMsTscNonScriptable secured = (MSTSCLib.IMsTscNonScriptable)remoteserver.SecuredSettings; //////secured.ClearTextPassword = cfg.password; //////remoteserver.Connect(); }
protected override void OnCreateControl() { rdpc = new AxMSTSCLib.AxMsRdpClient4(); rdpc.OnDisconnected += new AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEventHandler(rdpc_OnDisconnected); this.Controls.Add(rdpc); rdpc.Dock = DockStyle.Fill; base.OnCreateControl(); }
protected override void OnCreateControl() { rdpc = new AxMSTSCLib.AxMsRdpClient4(); rdpc.OnDisconnected += new AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEventHandler(rdpc_OnDisconnected); this.Controls.Add(rdpc); rdpc.Dock = DockStyle.Fill; base.OnCreateControl(); }