ActiveX 无法变更 求助

linux_DD 2010-06-15 09:11:16
我在网上找了一篇用c#生成activex的文章
大概是这样的
1.建立一个WinForm控件项目HelloWorld

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace HelloWorld
{
/**//// <summary>
/// UserControl1 的摘要说明。
/// </summary>
public class Demo : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Label label1;
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public Demo()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();

// TODO: 在 InitComponent 调用后添加任何初始化

}

/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
}

组件设计器生成的代码#region 组件设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(32, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(120, 32);
this.label1.TabIndex = 0;
this.label1.Text = "HelloWorld";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Demo
//
this.Controls.Add(this.label1);
this.Name = "Demo";
this.Size = new System.Drawing.Size(184, 96);
this.ResumeLayout(false);

}
#endregion
}
}


然后便已成一个HelloWorld.dll,将此dll拷贝到IIS的虚拟根目录下,然后建立一个helloworld.htm的文件,html代码如下:
<body bgcolor='#223344'>
<object id="helloworld" classid=’http://localhost:8088/HelloWorld.dll#HelloWorld.Demo’ Width="184" Height="96" VIEWASTEXT> </object>
</body>
8088还空着,就用这个了。

运行之后,这个lable倒是加载道页面显示出来了。
可在这以后我打算把这个lable换成一个button的时候有问题了。
不管我怎么换这个winform程序的控件,显示出来的还是刚才那个lable.
而且我用向下面那样用完全错误的dll名,错误的namespace名也能显示出来
<body bgcolor='#223344'>
<object id="helloworld" classid=’http://localhost:8088/HelladfasdfasfoWorld.dll#HelldfdfdfoWorld.Demo’ Width="184" Height="96" VIEWASTEXT> </object>
</body>

好像被什么地方给记住了,这到底是怎么回事呢,求解,谢谢。
...全文
48 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
辰爸 2010-06-21
  • 打赏
  • 举报
回复
重新引用dll也这样吗?清理下解决方案试下!·

8,834

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 组件/控件开发
社区管理员
  • 组件/控件开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧