none
Lectura de archivo .HEX alojado en servidor FTP RRS feed

  • Pregunta

  • Hola a todos, tengo un problema con la lectura de un archivo .HEX

    Estoy realizando la lectura de un archivo .HEX que se encuentra alojado en un servidor FTP. La lectura la realizo por buffers de 29 bytes, ya que cada 29 bytes para mi representa una estructura de datos, por ejemplo:

    byte[]{ ID, Día, Mes, Año, Hora, byte5, byte6,... byte28}

    Cada que realizo la lectura de esos 29 bytes verifico algunas condiciones sobre los bytes [Día,Mes,Año,Hora], es decir, comparo los bytes [Día,Mes,Año,Hora] del buffer con unos bytes que son pasados como argumentos a mi método.

    A continuación presento mi código:

    //============================================================================

        [WebMethod]
        public static string[] Hour(byte Dia, byte Mes, byte Ano, byte Hora)
        {
            FtpWebRequest Servidor = (FtpWebRequest)WebRequest.Create("Servidor");
            Servidor.Credentials = new NetworkCredential("Usuario", "Contraseña");
            Servidor.Method = WebRequestMethods.Ftp.DownloadFile;
            string[] Mediciones = new string[29];
            byte[] Datos = new byte[29];
            try
            {
                Stream Lectura = Servidor.GetResponse().GetResponseStream();
                int indice;
                while ((indice = Lectura.Read(Datos, 0, Datos.Length)) > 0)
                {
                    if ((Datos[1] == Dia) && (Datos[2] == Mes) && (Datos[3] == Ano) && (Datos[4] == Hora))
                    {
                        for (int i=0; i<29; i++)
                        {
                            Mediciones[i] = String.Format("{0:x2}", Datos[i]);
                        }
                    }
                }
                return Mediciones;
            }
            catch
            {
                return Mediciones;
            }
        }

    //=============================================================================

    Cuando los bytes[Día,Mes,Año,Hora] del buffer coinciden con los bytes de los argumentos pasados, lleno el array "Mediciones" con los datos del buffer recibidos.

    Mi problema es el siguiente:

    He notado que mientras mi Archivo alojado en el servidor FTP sea menor a 1.6KB, la lectura y comparación de los Bytes se ejecuta correctamente y se llena adecuadamente el array "Mediciones", pero cuando el tamaño del archivo excede dicho tamaño o el buffer de 29 bytes se encuentra por encima de 1.6KB, si se realiza la lectura pero no la comparación y por ende no llena el array "Mediciones" por lo que me regresa el array vacío.

    ¿Qué estoy haciendo mal?

    ¿Es algún problema de memoria o de configuración del servidor FTP?

    lunes, 20 de agosto de 2018 20:39

Respuestas

  • Hola:

    ¿Puedes subir el contenido del archivo hex por aquí? (aunque en apariencia no se entienda).

    ¿Es de una EEPROM, microcontrolador?

    Saludos.


    http://electronica-pic.blogspot.com

    Sí, el archivo es una bitácora de datos que toma el microcontrolador, y va subiendo el archivo al servidor:

    //====================================================================

    02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 12 01 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 02 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 03 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 04 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 05 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 06 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 07 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 08 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 09 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0A 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0B 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0C 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0D 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0E 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0F 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 10 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 11 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 12 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 13 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 14 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 15 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 16 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 17 AA 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 01 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 02 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 03 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 04 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 05 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 06 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 07 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0B 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0C 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0D 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0E 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0F 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 10 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 11 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00

    //===================================================================


    https://social.msdn.microsoft.com/Forums/es-ES/bba4ccb9-49df-4800-b92a-86a1f9520a9a/subir-archivos-a-ftp?forum=vcses

    Cómo cargar archivos mediante FTP,

    string ftpServerIP = "ftp.example.com";
    string ftpUserName = "username";
    string ftpPassword = "password";
    string filename = Server.MapPath("example.txt");
    		
    FileInfo objFile = new FileInfo(filename);
    
    FtpWebRequest objFTPRequest;
    
    // Create FtpWebRequest object 
    objFTPRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + objFile.Name));
    
    // Set Credintials
    objFTPRequest.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
    
    // By default KeepAlive is true, where the control connection is 
    // not closed after a command is executed.
    objFTPRequest.KeepAlive = false;
    
    // Set the data transfer type.
    objFTPRequest.UseBinary = true;
    
    // Set content length
    objFTPRequest.ContentLength = objFile.Length;
    
    // Set request method
    objFTPRequest.Method = WebRequestMethods.Ftp.UploadFile;
    
    // Set buffer size
    int intBufferLength = 16 * 1024;
    byte[] objBuffer = new byte[intBufferLength];
    
    // Opens a file to read
    FileStream objFileStream = objFile.OpenRead();
    		
    try
    {
      // Get Stream of the file
      Stream objStream = objFTPRequest.GetRequestStream();
    		
      int len = 0;
    		
      while ((len = objFileStream.Read(objBuffer, 0, intBufferLength)) != 0)
      {
        // Write file Content 
        objStream.Write(objBuffer, 0, len);
        
      }
    		
      objStream.Close();
      objFileStream.Close();
      
    } catch (Exception ex) {
    
      throw ex;
      
    } 

    https://gist.github.com/jgdoncel/7115782


    http://electronica-pic.blogspot.com

    martes, 21 de agosto de 2018 14:51

Todas las respuestas

  • Hola:

    ¿Puedes subir el contenido del archivo hex por aquí? (aunque en apariencia no se entienda).

    ¿Es de una EEPROM, microcontrolador?

    Saludos.


    http://electronica-pic.blogspot.com

    lunes, 20 de agosto de 2018 21:05
  • Hola:

    ¿Puedes subir el contenido del archivo hex por aquí? (aunque en apariencia no se entienda).

    ¿Es de una EEPROM, microcontrolador?

    Saludos.


    http://electronica-pic.blogspot.com

    Sí, el archivo es una bitácora de datos que toma el microcontrolador, y va subiendo el archivo al servidor:

    //====================================================================

    02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 12 01 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 02 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 03 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 04 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 05 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 06 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 07 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 08 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 09 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0A 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0B 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0C 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0D 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0E 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0F 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 10 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 11 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 12 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 13 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 14 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 15 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 16 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 17 AA 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 01 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 02 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 03 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 04 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 05 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 06 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 07 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0B 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0C 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0D 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0E 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0F 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 10 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 11 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00

    //===================================================================


    lunes, 20 de agosto de 2018 21:13
  • Hola:

    ¿Puedes subir el contenido del archivo hex por aquí? (aunque en apariencia no se entienda).

    ¿Es de una EEPROM, microcontrolador?

    Saludos.


    http://electronica-pic.blogspot.com

    Sí, el archivo es una bitácora de datos que toma el microcontrolador, y va subiendo el archivo al servidor:

    //====================================================================

    02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 12 01 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 02 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 03 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 04 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 05 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 06 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 07 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 08 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 09 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0A 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0B 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0C 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0D 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0E 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 0F 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 10 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 11 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 12 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 13 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 14 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 15 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 16 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 17 AA 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 01 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 02 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 03 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 04 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 05 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 06 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 03 07 08 13 07 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 02 07 08 12 00 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0B 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0C 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0D 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0E 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 0F 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 10 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00 01 14 08 12 11 00 00 05 00 0A 00 0F 00 14 00 19 00 1E 00 23 00 28 00 2D 00 32 00 37 00

    //===================================================================


    https://social.msdn.microsoft.com/Forums/es-ES/bba4ccb9-49df-4800-b92a-86a1f9520a9a/subir-archivos-a-ftp?forum=vcses

    Cómo cargar archivos mediante FTP,

    string ftpServerIP = "ftp.example.com";
    string ftpUserName = "username";
    string ftpPassword = "password";
    string filename = Server.MapPath("example.txt");
    		
    FileInfo objFile = new FileInfo(filename);
    
    FtpWebRequest objFTPRequest;
    
    // Create FtpWebRequest object 
    objFTPRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + objFile.Name));
    
    // Set Credintials
    objFTPRequest.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
    
    // By default KeepAlive is true, where the control connection is 
    // not closed after a command is executed.
    objFTPRequest.KeepAlive = false;
    
    // Set the data transfer type.
    objFTPRequest.UseBinary = true;
    
    // Set content length
    objFTPRequest.ContentLength = objFile.Length;
    
    // Set request method
    objFTPRequest.Method = WebRequestMethods.Ftp.UploadFile;
    
    // Set buffer size
    int intBufferLength = 16 * 1024;
    byte[] objBuffer = new byte[intBufferLength];
    
    // Opens a file to read
    FileStream objFileStream = objFile.OpenRead();
    		
    try
    {
      // Get Stream of the file
      Stream objStream = objFTPRequest.GetRequestStream();
    		
      int len = 0;
    		
      while ((len = objFileStream.Read(objBuffer, 0, intBufferLength)) != 0)
      {
        // Write file Content 
        objStream.Write(objBuffer, 0, len);
        
      }
    		
      objStream.Close();
      objFileStream.Close();
      
    } catch (Exception ex) {
    
      throw ex;
      
    } 

    https://gist.github.com/jgdoncel/7115782


    http://electronica-pic.blogspot.com

    martes, 21 de agosto de 2018 14:51