Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要从经典ASP页面调用.Net类库dll_.net_Vbscript_Asp Classic_Com Interop_Class Library - Fatal编程技术网

需要从经典ASP页面调用.Net类库dll

需要从经典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

我需要从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 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
一起使用

“…代码库条目为未安装在全局程序集缓存中的程序集指定文件路径…”-查看了解更多信息

查看: