简体   繁体   中英

Screen sharing Application in C# for Windows Xp with using RDP Viewer Class Component

I am trying to develop Basic Screen Sharing Application for in C# language for windows Xp.

I have develop Basic Application with using RDPCOMAPILib means rdpcomapi 1.0 type library

and RDPViewer Class Component . its works fine on windows 7 but its not work on windows XP because its not find RDPViewer Class Component I have created two module for this first for host and Second is Viewer In host its generate unique code which use for connect to remote computer. My code is below

using System.Runtime.InteropServices;

using 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;

    }

And Viewer Code is

    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;
    }
}

According to the MSDN articles for IRDPSRAPIAttendee and IRDPSRAPIInvitation , the APIs that you are trying to use are only available on Windows Vista and later. Thus, I don't think you'll be able them on Windows XP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM