Esempio n. 1
0
 public static bool Load()
 {
     using (FileStream Fs = File.Open("Config.json", FileMode.Open))
     {
         Data = (CheckerInfo) new DataContractJsonSerializer(typeof(CheckerInfo)).ReadObject(Fs);
     }
     return(true);
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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" } }
     };
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 public static Thread RunChecker(CheckerInfo Data)
 {
     return new Thread(() => InitializePHPProcess(Data, $"-c \"{Data.PHPIniPath}\" checker run \"{Data.AppId}\" "));
 }
Esempio n. 6
0
 public static Thread InstallZBA(CheckerInfo Data, string ZBAPath)
 {
     return new Thread(() => InitializePHPProcess(Data, $"-c \"{Data.PHPIniPath}\" checker install \"{ZBAPath}\" "));
 }