public string DescifrarZigZag([FromForm] UploadDataZigZag DescifrarZigZag) { if (!Directory.Exists(_environment.WebRootPath + "\\ArchivosDescifradosZigZag\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivosDescifradosZigZag\\"); } ZigZag DescifradoZigZag = new ZigZag(); DescifradoZigZag.DescifradoZigZag(DescifrarZigZag.ArchivoCargado, DescifrarZigZag.TamañoCarriles, DescifrarZigZag.NuevoNombre, _environment.WebRootPath + "\\ArchivosDescifradosZigZag\\"); return("El archivo descifrado se encuentra en la carpeta 'ArchivosDescifradosZigZag' en la Carpeta 'wwwroot' dentro de la carpeta del Laboratorio"); }
public void DecifradoDatos([FromForm] DataCipher _DataDeCipher, string decifrado) { MetodosNecesariosC _MetodosDecipher = new MetodosNecesariosC(); ZigZag _Zigzag = new ZigZag(); switch (decifrado.ToUpper()) { case "CEASER": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoDecifradoCeaser\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoDecifradoCeaser\\"); } _MetodosDecipher.DecifradoCeaser(_DataDeCipher.ArchivoCargado, _DataDeCipher.Llave, _DataDeCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoDecifradoCeaser\\"); break; case "ZIGZAG": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoDecifradoZigZag\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoDecifradoZigZag\\"); } _Zigzag.DescifradoZigZag(_DataDeCipher.ArchivoCargado, _DataDeCipher.TamanoCarriles, _DataDeCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoDecifradoZigZag\\"); break; case "ESPIRAL": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoDecifradoEspiral\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoDecifradoEspiral\\"); } _MetodosDecipher.DecifradoEspiral(_DataDeCipher.ArchivoCargado, _DataDeCipher.n, _DataDeCipher.m, _DataDeCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoDecifradoEspiral\\"); break; case "VERTICAL": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoDecifradoVertical\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoDecifradoVertical\\"); } _MetodosDecipher.DecifradoVertical(_DataDeCipher.ArchivoCargado, _DataDeCipher.n, _DataDeCipher.m, _DataDeCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoDecifradoVertical\\"); break; default: break; } }