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
#24
I executed successfully using the following method   Smile

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

;Todo:
;Write the  _s variable text to the class file "HSFun_Temp" in LA.
_s.setfile("$documents$\LibreAutomate\Main\files\HTTP\@HttpServer\HSFun_Temp.cs")

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

Quote: 
I guess it executes old code, that is why fast.

How to delete a temporary generated DLL?

So it looks like QM can remotely operate QM and LA on another computer  Tongue

It may be simpler to use the following method. How is it more reliable to receive parameters and write files in LA?

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

_s=LaHttpCall("Main2" F"cs={_s}" "name=Lisa"); out _s
;or
_s=LaHttpCall(F"cs={_s}" "Fun=Main2" "name=Lisa"); out _s


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

Forum Jump:


Users browsing this thread: 2 Guest(s)