我正在尝试在 C# 中制作一个简单的屏幕共享应用程序并找到了本指南:https ://www.c-sharpcorner.com/uploadfile/ulricht/how-to-create-a-simple-screen-sharing-application-in -C-Sharp/并跟随它,但它不起作用 我在同一台计算机和两台不同的 PC 上尝试过它,但似乎没有任何效果
//Host
public partial class ScreenShareHandler : Form
{
RDPSession x = new RDPSession();
public ScreenShareHandler()
{
InitializeComponent();
}
private void ScreenShareHandler_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;
}
}
//Client
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
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();
}
}
相关分类