Created
August 31, 2017 16:50
-
-
Save MartinAngeloni/a7e8133637899f3e084b770a9f7e8398 to your computer and use it in GitHub Desktop.
Esta es una aplicación de consola que escribe en un archivo .txt creado en un determinado lugar y luego lo lee.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.IO; | |
namespace ConsoleApp4ArchivosRepaso | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//para escribir archivos | |
StreamWriter stw = new StreamWriter(@"C:\Users\martin\Desktop\repaso.txt"); | |
using (stw) | |
{ | |
stw.WriteLine("LALALAND"); | |
} | |
stw.Close(); | |
//para leer el archivo | |
StreamReader str = new StreamReader(@"C:\Users\martin\Desktop\repaso.txt"); | |
using (str) | |
{ | |
String line = str.ReadLine(); | |
Console.WriteLine(line); | |
} | |
str.Close(); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment