public static bool Load() { using (FileStream Fs = File.Open("Config.json", FileMode.Open)) { Data = (CheckerInfo) new DataContractJsonSerializer(typeof(CheckerInfo)).ReadObject(Fs); } return(true); }
private static Process InitializePHPProcess(CheckerInfo Data, string Argument) { var p = new Process { StartInfo = InitializeProcessStartInfo(Data, Argument), }; p.Start(); p.OutputDataReceived += (eventSender, args) => ReceivedLog(args.Data); p.BeginOutputReadLine(); p.WaitForExit(); return p; }
private static ProcessStartInfo InitializeProcessStartInfo(CheckerInfo Data, string Argument) { return new ProcessStartInfo { FileName = Data.PHPPath, WorkingDirectory = Utils.ProgramPath, StandardOutputEncoding = Encoding.GetEncoding(65001),//Utils.GetCodePage()); Arguments = Argument, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true, EnvironmentVariables = { { "ConEmuANSI", "ON" }, { "APPCHECKER_GUI_CHARSET", "UTF-8" } } }; }
public static bool Load() { using (FileStream Fs = File.Open($"{Utils.ProgramPath}/Config.json", FileMode.Open)) { Data = (CheckerInfo)new DataContractJsonSerializer(typeof(CheckerInfo)).ReadObject(Fs); } return true; }
public static Thread RunChecker(CheckerInfo Data) { return new Thread(() => InitializePHPProcess(Data, $"-c \"{Data.PHPIniPath}\" checker run \"{Data.AppId}\" ")); }
public static Thread InstallZBA(CheckerInfo Data, string ZBAPath) { return new Thread(() => InitializePHPProcess(Data, $"-c \"{Data.PHPIniPath}\" checker install \"{ZBAPath}\" ")); }