您的位置:首页 > 编程语言 > ASP

在asp中调用.net 2.0生成的dll

2007-07-30 13:52 465 查看
、创建.Net 2.0的DLL,示例代码如下
using System;
using System.Collections.Generic;
using System.Text;

namespace Test
{
public class Test
{

public Test()
{
}

public string SayHello(string fInput)
{
return "HELLO " + fInput;
}
}
}

2、注册dll为com组件
(1)右键单击工程--》属性--》应用程序--》点击程序集信息--》最下面的复选框(使程序集Com可见)
(2)复制DLL到系统目录/SYSTEM32/下
(3)使用regasm注册DLL

3、在asp中调用DLL,文件名为TEST.ASP,代码如下
<%
set test = Server.CreateObject("Test.Test")
response.write test.SayHello("wichian")
set test = nothing
%>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: