Created
May 14, 2020 15:19
-
-
Save joecastelo/f685c91402d4c2dffc034c1f8d5ac039 to your computer and use it in GitHub Desktop.
Entry to ESAPI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ExecutableLogic; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
using VMS.TPS.Common.Model.API; | |
namespace VMS.TPS | |
{ | |
public class Script | |
{ | |
public Script() | |
{ | |
} | |
public static void Execute(ScriptContext context) | |
{ | |
Perform(context); | |
} | |
public static void Perform(ScriptContext context) | |
{ | |
string binFile = "\\"; | |
var dialog = new OpenFileDialog(); | |
if (dialog.ShowDialog() == DialogResult.OK) | |
{ | |
binFile = dialog.FileName; | |
} | |
else | |
{ | |
throw new System.Exception("Choose a file to run the executable"); | |
} | |
var args = ScriptContextArgs.From(context); | |
var runner = new RunStandalone(args.ToArgs()); | |
runner.RunProgram(binFile); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment