问题:asp代码如何访问net2005里的类?
1.我自定义了一个类:
using System;
namespace hello
{
public class HelloWorld
{
public string getUserInfo(string s)
{
return "HelloWorld";
}
}
}
编译得到:hello.dll
采用 regasm.exe hello.dll 注册dll
然后我写asp代码如下:
<%
Set cls1 =CreateObject("hello.HelloWorld")
response.write(cls1.getUserInfo())
%>
此时可以正确返回“HelloWorld”串。