Open
Description
using Jint;
...
var engine = new Engine()
.SetValue("log", new Action<object>(Console.WriteLine))
.Execute("function hello() { return 'Hello, world!'; }");
var result = engine.Invoke("hello");
Console.WriteLine(result); // Affiche "Hello, world!"
or
using Jint;
using System.IO;
...
var engine = new Engine()
.SetValue("log", new Action<object>(Console.WriteLine));
string jsCode = File.ReadAllText("chemin_vers_votre_fichier.js");
engine.Execute(jsCode);
var result = engine.Invoke("nom_de_la_fonction");
Console.WriteLine(result); // Affiche le résultat de la fonction JavaScript
Implement Stream
Metadata
Metadata
Assignees
Labels
No labels