private byte[] SubmitCommand(ShellStruct data, string funcNameXpath, string[] param, bool isBindUploadProgressChangedEvent, bool isBindDownloadProgressChangedEvent) { CustomShellType shellType = CustomShellTypeProvider.GetShellType(data.ShellType); CustomCommandCode customCommandCode = new CustomCommandCode(shellType, data.ShellPwd); Dictionary<string, string> commandCode = customCommandCode.GetCode(funcNameXpath, param); HttpClient httpClient = new HttpClient(); //if (isBindUploadProgressChangedEvent) // httpClient.UploadFileProgressChangedToDo += httpClient_UploadFileProgressChangedToDo; //if (isBindDownloadProgressChangedEvent) // httpClient.DownloadFileProgressChangedToDo += httpClient_DownloadFileProgressChangedToDo; return httpClient.SubmitCommandByPost(data.ShellUrl, commandCode); }
/// <summary> /// 提交命令 /// </summary> /// <param name="data">shellstruct数据</param> /// <param name="funcNameXpath">xpath表示的方法名(/cmder/readfile)</param> /// <param name="param"></param> /// <returns></returns> private byte[] SubmitCommand(ShellStruct data, string funcNameXpath, string[] param) { CustomShellType shellType = CustomShellTypeProvider.GetShellType(data.ShellType); CustomCommandCode customCommandCode = new CustomCommandCode(shellType, data.ShellPwd); Dictionary<string, string> commandCode = customCommandCode.GetCode(funcNameXpath, param); HttpClient httpClient = new HttpClient(); return httpClient.SubmitCommandByPost(data.ShellUrl, commandCode); }