コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
ファイル: DbManager.cs プロジェクト: TinSyner/github_spider
        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));
        }
コード例 #5
0
ファイル: DbManager.cs プロジェクト: TinSyner/github_spider
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: DbManager.cs プロジェクト: TinSyner/github_spider
        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;
        }
コード例 #8
0
        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;
        }
コード例 #9
0
 /// <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;
     });
 }
コード例 #10
0
ファイル: ShellCmder.cs プロジェクト: TinSyner/github_spider
        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)));
        }
コード例 #11
0
        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());
        }
コード例 #12
0
ファイル: ShellCmder.cs プロジェクト: TinSyner/github_spider
 public OsInfo GetSysInfo()
 {
     byte[] resultBytes = SubmitCommand(_shellData, "Cmder/SysInfoCode", null);
     return(ResultMatch.MatchResultToOsInfo(resultBytes, Encoding.GetEncoding(_shellData.WebCoding)));
 }
コード例 #13
0
 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));
 }
コード例 #14
0
 private void getWwwRootPath_DoWork(object sender, DoWorkEventArgs e)
 {
     byte[] resultBytes = SubmitCommand(_shellData, "FileManager/WwwRootPathCode", null);
     e.Result = ResultMatch.MatchResultToOsDisk(resultBytes, Encoding.GetEncoding(_shellData.WebCoding));
 }
コード例 #15
0
 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));
 }
コード例 #16
0
 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));
 }