Saber si existe un fichero

1988 vistas

Vamos a usar la clase System.IO.File y su método Exists



csharp
  1. if(System.IO.File.Exists("c:\mifichero.txt"))
  2. // el fichero existe
  3. else
  4. // el fichero NO existe