Ver Mensaje Individual
  #1  
Antiguo 14-08-2024
REHome REHome is offline
Miembro
 
Registrado: jul 2003
Ubicación: España
Posts: 475
Reputación: 23
REHome Va por buen camino
Guardar y leer archivo de texto

Guardar, guardo así en C#.
Código:
File.WriteAllText("Archivo.txt", opA + opB + opC);
Al leer lo intenté así pero no tiene el comportamiento deseado.
Código:
                // Crear archivo y guarda el * seleccioinado en él.
                if (File.Exists("Archivo.txt"))
                {
                    string data = File.ReadAllText("Archivo.txt");
                    opA = Convert.ToString(data);
                    opB = Convert.ToString(data);
                    opC = Convert.ToString(data);
                }
¿Cómo se hace?

Saludos colegas.
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino.
Responder Con Cita