在 VBScript 中访问自定义 .NET DLL [英] Access a custom .NET DLL in VBScript

查看:20
本文介绍了在 VBScript 中访问自定义 .NET DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .NET 中编写了一个 DLL,我想在 VBScript 中访问它.我不想将它添加到程序集目录中.

I wrote a DLL in .NET and I want to access it in VBScript. I don't want to add it to the assembly directory.

有没有办法指向 DLL 并创建它的实例?

Is there a way to point too the DLL and create an instance of it?

推荐答案

您可以使用 regasm 实用程序 通过指定 /codebase 参数.不鼓励将此参数用于未签名的程序集,但当您无法将程序集放入 GAC 时,它会起作用.

You can register that .NET dll with regasm utility by specifying /codebase parameter. This parameter is not encouraged to use with unsigned assemblies but it works when you can not put your assembly into GAC.

regasm your.dll /codebase

请注意,在此操作后您不应更改 .dll 的路径,因为它会将此路径插入到 Windows 注册表中.

Please note that you should not change your .dll's path after this operation since it inserts this path into the Windows registry.

这篇关于在 VBScript 中访问自定义 .NET DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆