Calling a c # function from a VBScript function in a web interface

I need to call or at least pass parameters in C # functions from a VBScript function (or a suitable workaround) on a Microsoft Azure website ie:

Function VBScriptFnc(param_1, param_2, param_3)

  Dim flag;

  flag = 1

    'call the C# function or somehow pass parameters into C# function'
    csharpFunction(param_1, param_2, param_3)


  VBScriptFnc = flag

End Function

      

+3


source to share


2 answers


VBScript has 5 windows in the .NET world:



The easiest option on the website is to use GET or POST because you will avoid the ACL and COM registration minefields, but if you have to go the other way, I would say PowerShell is your best bet followed by COM interop as a third option.

+5


source


You need to mark your assembly as COM visible by setting the COMVisibleAttribute to true (either at the assembly level or at the class level if you only want to expose one type).

Then you register it with:

regasm /codebase MyAssembly.dll

      



and finally call it from VBScript:

dim myObj
Set myObj = CreateObject("MyNamespace.MyObject")

      

This question Originally Posted by Darin Dimitrov Here .

+1


source







All Articles