Skip to content

Instantly share code, notes, and snippets.

@MikeCodesDotNET
Created May 11, 2020 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeCodesDotNET/b900f7d5f7cd53bd3afdc1ead6d68285 to your computer and use it in GitHub Desktop.
Save MikeCodesDotNET/b900f7d5f7cd53bd3afdc1ead6d68285 to your computer and use it in GitHub Desktop.
public static async Task Main(string[] args)
{
var userScriptPath = Path.Combine(Environment.CurrentDirectory, "scriptInput.txt");
var fileContents = File.ReadAllText(userScriptPath);
Script script = CSharpScript.Create(fileContents, ScriptOptions.Default);
var result = await script.RunAsync();
Console.WriteLine($"Seconds in a week: {result.GetVariable("seconds").Value}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment