[英]Screen sharing Application in C# for Windows Xp with using RDP Viewer Class Component
我正在尝试为Windows Xp开发C#语言的基本屏幕共享应用程序。
我已经使用RDPCOMAPILib开发了rdpcomapi 1.0类型库的基本应用程序
和RDPViewer类组件 。 它在Windows 7上可以正常工作,但在Windows XP上却不能正常工作,因为它找不到RDPViewer类组件。我为此主机创建了两个模块,第二个是为主机创建的模块,第二个是Viewer。 我的代码如下
使用System.Runtime.InteropServices;
使用RDPCOMAPILib;
RDPSession x = new RDPSession();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Incoming(object Guest)
{
IRDPSRAPIAttendee MyGuest = (IRDPSRAPIAttendee)Guest;//???
MyGuest.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_INTERACTIVE;
}
private void button1_Click(object sender, EventArgs e)
{
x.OnAttendeeConnected += Incoming;
x.Open();
}
private void button2_Click(object sender, EventArgs e)
{
IRDPSRAPIInvitation Invitation = x.Invitations.CreateInvitation("Trial", "MyGroup", "", 10);
textBox1.Text = Invitation.ConnectionString;
}
private void button3_Click(object sender, EventArgs e)
{
x.Close();
x = null;
}
观看者代码为
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string Invitation = textBox1.Text;// "";// Interaction.InputBox("Insert Invitation ConnectionString", "Attention");
axRDPViewer1.Connect(Invitation, "User1", "");
}
private void button2_Click(object sender, EventArgs e)
{
axRDPViewer1.Disconnect();
}
private void Form1_Load(object sender, EventArgs e)
{
panel1.Height = Screen.PrimaryScreen.Bounds.Height - 100;
}
}
根据有关IRDPSRAPIAttendee和IRDPSRAPIInvitation的MSDN文章,您尝试使用的API仅在Windows Vista和更高版本上可用。 因此,我认为您无法在Windows XP上使用它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.