Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- namespace PracticandoUno
- {
- class Program
- {
- static void Main(string[] args)
- {
- string arc;
- Console.WriteLine("Escriba una ruta \n");
- arc = Console.ReadLine();
- try
- {
- string[] archivos = System.IO.Directory.GetFiles(arc);
- //recorremos todos los archivos y los escribimos en consola
- foreach (var a in archivos)
- {
- }
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- string dir;
- string[] archivo = Directory.GetFiles(arc);
- StreamReader leer;
- StreamReader leerV = new StreamReader("/Users/alanispw/Desktop/Virus.txt");
- string s;
- s = leerV.ReadLine();
- while (s != null) {
- }
- /*
- foreach (var j in archivo)
- {
- using (leer = new StreamReader(j)) {
- while (!leer.EndOfStream)
- {
- dir = leer.ReadLine();
- Console.WriteLine(dir);
- // /Users/alanispw/Desktop/queseyo
- }
- }
- } */
- /* if (archivos.Length == 0)
- Console.WriteLine ("No se encontro archivos en" + dir);
- else
- foreach (string s in archivos)
- {
- Console. WriteLine(s);
- try
- {
- File. Open(s, FileMode.Open, FileAccess.ReadWrite);
- }
- catch (Exception e)
- {
- Console. WriteLine(e.Message);
- }
- } */
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement