创建一个ActiveX RDP客户端(C#) [英] Create an ActiveX RDP Client (C#)

查看:213
本文介绍了创建一个ActiveX RDP客户端(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想使用现有的MSRDP库创建(Visual Studio 2008)一个新的Terminal Services ActiveX组件.

我成功使用终端服务组件为正常"应用程序创建了Windows窗体.
但是我想将其作为ActiveX嵌入HTML页面中.

我可以使用原始的Mirosoft组件来完成此操作,但是我的组件有一个空白页.
我尝试了一个简单的文本框(以查看是否不是我的错误),并且可以正常工作.
我使用拖放"来自动生成"InitializeComponent" UserControl方法.

这是:

Hi,

I want to create (Visual Studio 2008) a new Terminal Services ActiveX component using the existing MSRDP libraries.

I succeeded in creating a Windows Form with the Terminal Services Component for a ''normal'' application.
But I want to embed it within an HTML page as an ActiveX.

I can do it with the original Mirosoft Component but I have a blank page with my component.
I tried with a simple textbox (to see if it was not an error of me) and it worked.
I use the ''drag and drop'' to auto-generate the ''InitializeComponent'' UserControl method.

Here it is :

private void InitializeComponent()
    {
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Test));
      this.axMsTscAx1 = new AxMSTSCLib.AxMsRdpClient2();
      ((System.ComponentModel.ISupportInitialize)(this.axMsTscAx1)).BeginInit();

      //
      // axMsTscAx1
      //
      this.axMsTscAx1.Enabled = true;
      this.axMsTscAx1.Location = new System.Drawing.Point(58, 17);
      this.axMsTscAx1.Name = "axMsTscAx1";
      this.axMsTscAx1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMsTscAx1.OcxState")));
      this.axMsTscAx1.Size = new System.Drawing.Size(192, 192);
      this.axMsTscAx1.TabIndex = 1;
      

      this.Controls.Add(this.axMsTscAx1);
      ((System.ComponentModel.ISupportInitialize)(this.axMsTscAx1)).EndInit();

    }


没有生成错误. dll注册好.但是,当我启动HTML时(使用带有相应CLSID的"object"标签)时,我的空白页内部有一个红色的十字(ActiveX未正确加载).

非常感谢您的帮助.


No generation error. Dll registration ok. But I have a blank page with a red cross inside (the ActiveX is not loaded properly) when I launch the HTML (using the ''object'' tag with the corresponding CLSID).

Many thanks for your help.

推荐答案

我启动了AxImp.exe实用程序,以使用/keyfile参数创建两个库AxMSTSCLib.dll和MsTSCLib.dll.这会导致我的snk项目密钥.

我已将生成的库导入我的项目中,并使用它们来创建我的组件.

终端服务组件很好地嵌入在UserControl中,并很好地显示在我的HTML页面中.
I''ve launched the AxImp.exe utility to create the two libraries AxMSTSCLib.dll and MsTSCLib.dll with the /keyfile argument which leads to my snk project key.

I''ve imported the generated libraries in my project and used them to create my component.

The Terminal Service Component is well embedded in a UserControl and is well displayed in my HTML page.


这篇关于创建一个ActiveX RDP客户端(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆