private PhantomServer() { _process = new Process { StartInfo = { WorkingDirectory = _phantomJsFolder, FileName = "\"" + _phantomJsPath + "\"", Arguments = string.Format("--config={0} {1}", ConfigFileName, ScriptFileName), RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, CreateNoWindow = true, StandardOutputEncoding = Encoding.UTF8, UseShellExecute = false, WindowStyle = ProcessWindowStyle.Hidden } }; _process.Start(); _stdin = _process.StandardInput; _stdout = _process.StandardOutput; _stderror = _process.StandardError; _stdin.AutoFlush = true; _job = new Job(); _job.AddProcess(_process.Handle); }
private PhantomServer() { var tempDirectory = PathUtil.Resolve(GlobalSettingsFacade.TempDirectory); var cachePath = Path.Combine(tempDirectory, "phantomjs_cache"); var localStoragePath = Path.Combine(tempDirectory, "phantomjs_ls"); _process = new Process { StartInfo = { WorkingDirectory = _phantomJsFolder, FileName = "\"" + _phantomJsPath + "\"", Arguments = $"\"--local-storage-path={localStoragePath}\" \"--disk-cache-path={cachePath}\" --config={ConfigFileName} {ScriptFileName}", RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, CreateNoWindow = true, StandardOutputEncoding = Encoding.UTF8, UseShellExecute = false, WindowStyle = ProcessWindowStyle.Hidden } }; _process.Start(); _stdin = _process.StandardInput; _stdout = _process.StandardOutput; _stderror = _process.StandardError; _stdin.AutoFlush = true; _job = new Job(); _job.AddProcess(_process.Handle); }