Custom Module to Execute C#, VB.NET or JScript Code

Today I published a Robin module to execute C#, VBdotNET or JScript code seamlessly. The module contains four actions:

  • AddAssembly - to add an assembly to dotNETRunner
  • ClearAssemblies - to clear the added assemblies.
  • CompileFile - to compile the source code in the file.
  • Run - to execute a method with parameters and delivers the result.

Here an easy example, at the first an VBdotNET code.

Namespace Foo
  Public Class Bar

    Public Function SayHelloFunc() As String
      SayHelloFunc = "Hello World"
    End Function

  End Class
End Namespace

And now the Robin code to compile the code and execute the method SayHelloFunc.

dotNETRunner.CompileFile \
  FileName : "C:\Users\Robin\Examples\Test.dotNETRunner.vb" \
  Language : 'VB' \
  ErrorReturn => ErrorReturn

if ErrorReturn <> "" then
  Console.Write Message : ErrorReturn
  exit
end

dotNETRunner.Run \
  Instance : "Foo.Bar" \
  Method : "SayHelloFunc" \
  Result => strHelloResult \
  ErrorReturn => ErrorReturn

if ErrorReturn <> "" then
  Console.Write Message : ErrorReturn
  exit
end

Console.Write Message : strHelloResult

We compile the code and execute the method SayHelloFunc, which delivers Hello World.

The dotNETRunner module offers the possibility to add consolidated C#, VBdotNET or JScript code into a Robin process. You can develop your code into your favorite development environment and use it seamlessly in Robin.

You can find dotNETRunner module at my homepage.

1 Like

Hello @StefanSchnell, welcome to the forum and thanks so much for your module.
I just ran the example in Robin.dotNETRunner.1.0.0.pdf, perfect.
I then modified the example VB.Net file just a bit to check out the System.Windows.Forms capability:

Imports System.Windows.Forms
Namespace Foo
Public Class Bar
Public Function SayHelloFunc() As String
SayHelloFunc = "Hello World"
System.Windows.Forms.MessageBox.Show("I am a dotNET message box!")
End Function
End Class
End Namespace

Result:
msgbox

Very impressive web page you have, as are your credentials. I notice you list AutoIt as one of your languages - I use AutoHotkey quite a bit, and am going to experiment with your dotNETRunner.COM module also.

I think this is a fantastic contribution to Robin.

Best regards,
burque505

1 Like

@burque505

Hello Winter,
thank you very much for your reply :grinning:
As far as I can see are AutoIt and AutoHotKey (AHK) very similar and it should be possible to use dotNETRunner for COM with AHK too.
Best regards
Stefan

1 Like