开发者

how can i access C# dll from VBScript on client machine

开发者 https://www.devze.com 2022-12-25 00:58 出处:网络
i have created a C# dll file on my machine as shown below: namespace myDLL { public class myClass { 开发者_StackOverflow public string myFunction()

i have created a C# dll file on my machine as shown below:

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

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

When i created an object of type myClass on my machine using VBScript, everything is working 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 is running on another machine, how can i do this. please help me how can i access that dll file, am using the CreateObject() function as shown below:

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

now am getting error as "permission denied".


It appears that this is supported if the assembly is built with as COM visibility enabled.

Is it possible to execute a .NET assembly(dll) from vbscript?

By the way, I was pretty delighted to find out that there is a JScript compiler for .NET which allows one to write .NET code using JScript and also to target other .NET assemblies but unfortunately I haven't found anything similar for VBScript.

0

精彩评论

暂无评论...
验证码 换一张
取 消