/// <summary> /// <para>Reads inputed file and exports processed reversed file</para> /// </summary> /// <param name="filePath"></param> /// <returns></returns> public string DeformFile(string filePath) { // Get Original Filename & File Binary var filename = Path.GetFileName(filePath); var fileBinary = File.ReadAllBytes(filePath); fileBinary = fileBinary.Encrypt("password", new byte[] { 0x01, 0x02, 0x03 }); Array.Reverse(fileBinary); // Destination file and content var destinationFilename = StringToBase64String(filename); var destinationContent = fileBinary; // Gets Current Path & Writes final File var path = GetPath(filePath); var outfilePath = Path.Combine(path, destinationFilename); if (File.Exists(outfilePath)) { outfilePath = String.Empty; } else { WriteOutput(outfilePath, destinationContent); } return outfilePath; } /// <summary> /// <para>Reads processed inputed file and exports original file</para> /// </summary> /// <param name="filePath"></param> /// <returns></returns> public string FormFile(string filePath) { // Get Processed Filename & File Binary var filename = Path.GetFileName(filePath); var fileText = File.ReadAllBytes(filePath); // Destination file and content var destinationFilename = Base64StringToString(filename); var destinationContent = fileText; Array.Reverse(destinationContent); destinationContent = destinationContent.Decrypt("password", new byte[] { 0x01, 0x02, 0x03 }); // Gets Current Path & Writes final File var path = GetPath(filePath); var outfilePath = Path.Combine(path, destinationFilename); if (File.Exists(outfilePath)) { outfilePath = String.Empty; } else { WriteOutput(outfilePath, destinationContent); } return outfilePath; }