How can I access C # dll from VBScript on a client machine

I created a C # dll file on my computer as shown below:

namespace myDLL { public class myClass { public string myFunction() { return "I am Here"; } } } 

then I created a tlb file with the command "tlbexp", then I used the command "regasm" n registered this DLL on my machine.

When I created an object of type myClass on my machine using VBScript, everything worked fine ... here I used the CreateObject () method, as shown below:

 Set myObj = CreateObject("myDll.myClass") 

Now I want to create an object of type myClass from VBScript that works on another machine, how can I do this. please help me how can I access this dll file using the CreateObject() function as shown below:

 Set HD = CreateObject("myDll.myClass","myMachineName") 

now I get the error as "permission denied."

+4
source share
1 answer

This seems to be supported if the assembly is built using COM visibility .

Is it possible to build .NET (dll) from vbscript?

By the way, I was very glad to know that there is a JScript compiler for .NET that allows you to write .NET code using JScript, as well as configure other .NET assemblies, but, unfortunately, I did not find anything similar for VBScript.

+1
source

Source: https://habr.com/ru/post/1305655/


All Articles