Windows XP用のC#言語で基本的な画面共有アプリケーションを開発しようとしています。
RDPCOMAPILibを使用して基本アプリケーションを開発しました。これは、 rdpcomapi 1.0 タイプ ライブラリを 意味します。
およびRDPViewer クラス コンポーネント。Windows 7では正常に動作しますが、 RDPViewerクラスコンポーネントが見つからないため、Windows XPでは動作しません。最初はホスト用、2番目はViewer Inホスト用の2つのモジュールを作成し、リモートコンピューターへの接続に使用する一意のコードを生成します。私のコードは以下です
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;
}
}