Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compile and run C# code string sent from QM to the LA HTTP server
#11
Quote:I want to know some reasons why people want to pass C# code to LA to compile and execute

Previously, I had some PowerShell automation scripts that were difficult to implement using PowerShell. Due to the availability of existing C# code, I edited the C# code using LINQPad and then called and executed it using the command line method below.

lprun7 -lang=P cs8.linq "Lisa"

until I met QM. Now I use QM exclusively to achieve my goals.

For my work, using QM is enough, but C# has many free libraries and functions, which can be a supplement to QM.

Quote:Use C# compiler at run time

It seems a bit complicated. I have a simple unverified idea:
In QM, send a window message to LA to append the C# code to the end of the HTTP server script.
Then execute the command in QM, Is this possible?
LaHttpCall("Main2" "name=Lisa")

Macro Macro10
Code:
Copy      Help
_s=
;public static string Main2(string name) {
;,string r = $"hello {name}";
;,Console.WriteLine(r);
;,return r;
;}

;Todo: send a window message to LA to append the C# code to the end of the HTTP server script
;SendMessage


_s=LaHttpCall("Main2" "name=Lisa"); out _s


Messages In This Thread
RE: Call C# functions from anywhere using URL (HTTP server) - by Davider - 06-20-2023, 03:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)