title: How to make a screen share application
body: <p>I am trying to make a simple screen share application in C# and found this guide: <a href="https://www.c-sharpcorner.com/uploadfile/ulricht/how-to-create-a-simple-screen-sharing-application-in-C-Sharp/" rel="nofollow noreferrer">https://www.c-sharpcorner.com/uploadfile/ulricht/how-to-create-a-simple-screen-sharing-application-in-C-Sharp/</a> and followed it but it doesn't work i tried it on the same computer and on two different PCs but nothing seems to work   </p>
  
  <pre><code>//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();
          }
  }
  </code></pre>