public static string MakeCommandRunCofile(string path_run, CofileOption type, bool isEncrypt, string path, string configname, bool isDirectory) { string str = path_run; str += " " + type.ToString().ToLower(); if (isEncrypt) { str += " -e"; } else { str += " -d"; } string[] split = path.Split('/'); string filename = split[split.Length - 1]; if (!isDirectory) { str += " -f " + filename; } //switch(type) //{ // case CofileOption.sam: // str += " -i " + path; // if(isEncrypt) // str += " -o " + path + ".coenc"; // else // str += " -o " + path + ".codec"; // break; // case CofileOption.file: // str += " -f " + filename; // break; // case CofileOption.tail: // str += " -f " + path; // break; //} if (configname != null) { str += " -c " + configname; } //if(type == CofileOption.file) //{ // str += " -id " + path.Substring(0, path.Length - filename.Length); //} if (isDirectory) { str += " -id " + path; } else { str += " -id " + path.Substring(0, path.Length - filename.Length); } return(str); }
public static string MakeCommandRunCofile(string path_run, CofileOption type, bool isEncrypt, string path, string configname) { string str = path_run; str += " " + type.ToString().ToLower(); if (isEncrypt) { str += " -e"; } else { str += " -d"; } switch (type) { case CofileOption.sam: str += " -i " + path; if (isEncrypt) { str += " -o " + path + ".coenc"; } else { str += " -o " + path + ".codec"; } break; case CofileOption.file: case CofileOption.tail: str += " -f " + path; break; } if (configname != null) { str += " -c " + configname; } return(str); }