代码拉取完成,页面将自动刷新
using RDPCOMAPILib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AxRDPCOMAPILib;
using AxMSTSCLib;
using RdpClient.Library;
namespace RdpClient
{
public partial class frmRdpClient : Form
{
public frmRdpClient()
{
InitializeComponent();
}
private void RdpSessionOnOnAttendeeConnected(object pAttendee)
{
IRDPSRAPIAttendee att = pAttendee as IRDPSRAPIAttendee;
LogClass.Instance.Debug(att.RemoteName);
att.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_VIEW;//这个一定要有
}
public void Connection(string Server, string UserName, string Password, int Port = 3389)
{
axMsRdpClient9.DesktopWidth = SystemInformation.WorkingArea.Width;
axMsRdpClient9.DesktopHeight = SystemInformation.WorkingArea.Height - 30;
axMsRdpClient9.FullScreen = false;
axMsRdpClient9.Server = Server;
axMsRdpClient9.AdvancedSettings9.RDPPort = Port;
axMsRdpClient9.UserName = UserName;
if (!string.IsNullOrEmpty(Password))
{
axMsRdpClient9.AdvancedSettings9.ClearTextPassword = Password;
}
axMsRdpClient9.AdvancedSettings9.ConnectToAdministerServer = true;
axMsRdpClient9.AdvancedSettings9.ConnectToServerConsole = true;
axMsRdpClient9.AdvancedSettings9.RedirectClipboard = true;
axMsRdpClient9.AdvancedSettings9.EnableCredSspSupport = true;
axMsRdpClient9.ColorDepth = 16;
axMsRdpClient9.OnFatalError += AxMsRdpClient9_OnFatalError;
axMsRdpClient9.Connect();
}
private void AxMsRdpClient9_OnFatalError(object sender, IMsTscAxEvents_OnFatalErrorEvent e)
{
LogClass.Instance.Debug("errorCode=" + e.errorCode);
}
private void frmRdpClient_Load(object sender, EventArgs e)
{
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。