需要从经典ASP页面调用.Net类库dll
我需要从vbscript应用程序调用.Net类库需要从经典ASP页面调用.Net类库dll,.net,vbscript,asp-classic,com-interop,class-library,.net,Vbscript,Asp Classic,Com Interop,Class Library,我需要从vbscript应用程序调用.Net类库 我编写了一个C#类库,创建了一个COM DLL组件和一个类型库文件 我已使用在本地计算机上成功注册了dll和tlb C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\user\Visual Studio 2008\Projects\[Sample]\[Sample]\bin\Debug\[Sample].dll" /tlb "C:\user\Visual Stud
我编写了一个C#类库,创建了一个COM DLL组件和一个类型库文件
我已使用在本地计算机上成功注册了dll和tlb
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
"C:\user\Visual Studio 2008\Projects\[Sample]\[Sample]\bin\Debug\[Sample].dll"
/tlb "C:\user\Visual Studio 2008\Projects\[Sample]\[Sample]\bin\Debug\[Sample].tlb"
dll和类型库文件已成功注册我可以在windows注册表中看到它们 现在问题是在asp页面中访问它:
<%@ Language=VBScript %>
<html>
<body>
<%
dim cls
dim myDevelopmentDBConn
Set myDevelopmentDBConn = Server.CreateObject("ADODB.Connection")
With myDevelopmentDBConn
.Provider = "SQLNCLI"
.ConnectionString = "user ID=abc;password=abc;Initial Catalog=TestLdb;Data
Source=sqlservername"
.ConnectionTimeout = 600
.CommandTimeout = 600
.Open
End With
Response.Write myDevelopmentDBConn
Set myDevelopmentDBConn =nothing
Set cls = Server.CreateObject("Sample.SqlJobs") 'SqlJobs is the name of the class
Response.Write cls
'Response.Write "<b>" & cls.UpdateSqlJob("Test1","sqlservername", "abc", "abc" ) & "</b>"
'Test1=sqlserverjob name
'abc-username
'abc-password
Set cls =nothing
%>
</body>
</html>
如果您的程序集未安装到GAC中,则应将/codebase
命令行开关与regasm
一起使用
“…代码库条目为未安装在全局程序集缓存中的程序集指定文件路径…”-查看了解更多信息查看: