private void wget_DoWork(object sender, DoWorkEventArgs e) { string[] par = e.Argument as string[]; byte[] resultBytes = SubmitCommand(_shellData, "FileManager/WgetCode", par); e.Result = ResultMatch.MatchResultToBool(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void getFileTree_DoWork(object sender, DoWorkEventArgs e) { string dirPath = e.Argument as string; byte[] resultBytes = _hostService.SubmitCommand(_shellData, "FileManager/FileTreeCode", new string[] { dirPath }); e.Result = ResultMatch.MatchResultToOsFile(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void deleteFileOrDir_DoWork(object sender, DoWorkEventArgs e) { string fileOrDirPath = e.Argument as string; byte[] resultBytes = _hostService.SubmitCommand(_shellData, "FileManager/DeleteFileOrDirCode", new string[] { fileOrDirPath }); e.Result = ResultMatch.MatchResultToBool(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void connectDb_DoWork(object sender, DoWorkEventArgs e) { string par = e.Argument as string; byte[] resultBytes = SubmitCommand(_shellData, "DbManager/" + _dbType + "/ConnectDb", new string[] { par }); e.Result = ResultMatch.MatchResultToBool(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void executeNonQuery_DoWork(object sender, DoWorkEventArgs e) { string[] par = e.Argument as string[]; byte[] resultBytes = SubmitCommand(_shellData, "DbManager/" + _dbType + "/ExecuteNonQuery", par); string tmp = ResultMatch.GetResultFromInterval(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); e.Result = ConvertStrToDataTable(tmp); }
private void download_DoWork(object sender, DoWorkEventArgs e) { string[] par = e.Argument as string[]; byte[] resultBytes = _hostService.SubmitCommand(_shellData, "FileManager/DownloadFileCode", new string[] { par[0] }); byte[] fileBytes = ResultMatch.MatchResultToFile(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); e.Result = SaveFile(par[1], fileBytes); }
private void getColumnType_DoWork(object sender, DoWorkEventArgs e) { string[] par = e.Argument as string[]; byte[] resultBytes = SubmitCommand(_shellData, "DbManager/" + _dbType + "/GetColumnType", par); string tmp = ResultMatch.GetResultFromInterval(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); string[] columns = tmp.Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); e.Result = columns; }
private void getDdName_DoWork(object sender, DoWorkEventArgs e) { string par = e.Argument as string; byte[] resultBytes = _host.Core.SubmitCommand(_shellData, "DbManager/" + _dbType + "/GetDbName", new string[] { par }); string tmp = ResultMatch.GetResultFromInterval(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); string[] dbs = tmp.Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); e.Result = dbs; }
/// <summary> /// 网站监控对象 /// </summary> /// <param name="options"></param> /// <param name="loggerFactory"></param> /// <exception cref="ArgumentNullException"></exception> public WebSiteItem(WebSiteOptions options, ILoggerFactory loggerFactory) : base(options) { this.options = options; this.resultMatch = new ResultMatch(options.ResultMatch); this.httpApiFactory = new HttpApiFactory <IWebSiteApi>().ConfigureHttpApiConfig(c => { c.LoggerFactory = loggerFactory; }); }
public CmdResult ExecuteCmd(string cmdPath, string command, string currentDir, bool isWin) { //若cmdPath未设置,则采用默认值 if (string.IsNullOrEmpty(cmdPath)) { cmdPath = isWin ? "cmd" : "/bin/sh"; } //组合cmd命令 string combineCommand = string.Format(isWin ? "cd /d \"{0}\"&{1}&echo [S]&cd&echo [E]" : "cd \"{0}\";{1};echo [S];pwd;echo [E]", currentDir, command); byte[] resultBytes = SubmitCommand(_shellData, "Cmder/ExecuteCommandCode", new [] { cmdPath, combineCommand }); return(ResultMatch.MatchResultToCmdResult(resultBytes, Encoding.GetEncoding(_shellData.WebCoding))); }
public OsInfo GetSysInfo() { if (_host.SubmitCommand != null) { byte[] resultBytes = _host.SubmitCommand(_shellData, "Cmder/SysInfoCode", null); return(ResultMatch.MatchResultToOsInfo(resultBytes, Encoding.GetEncoding(_shellData.WebCoding))); } else { _host.ShowMsgInAppDialog("SubmitCommand未赋值"); } return(new OsInfo()); }
public OsInfo GetSysInfo() { byte[] resultBytes = SubmitCommand(_shellData, "Cmder/SysInfoCode", null); return(ResultMatch.MatchResultToOsInfo(resultBytes, Encoding.GetEncoding(_shellData.WebCoding))); }
private void readFile_DoWork(object sender, DoWorkEventArgs e) { string[] filePath = e.Argument as string[]; byte[] resultBytes = SubmitCommand(_shellData, "FileManager/ReadFileCode", filePath); e.Result = ResultMatch.MatchResultToString(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void getWwwRootPath_DoWork(object sender, DoWorkEventArgs e) { byte[] resultBytes = SubmitCommand(_shellData, "FileManager/WwwRootPathCode", null); e.Result = ResultMatch.MatchResultToOsDisk(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void createDir_DoWork(object sender, DoWorkEventArgs e) { string[] dirPath = e.Argument as string[]; byte[] resultBytes = SubmitCommand(_shellData, "FileManager/CreateDirCode", dirPath); e.Result = ResultMatch.MatchResultToBool(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }
private void modifyFileOrDirTime_DoWork(object sender, DoWorkEventArgs e) { string[] par = e.Argument as string[]; byte[] resultBytes = _hostService.SubmitCommand(_shellData, "FileManager/ModifyFileOrDirTimeCode", par); e.Result = ResultMatch.MatchResultToBool(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)); }