Alguien entiende esto???

25/05/2007 - 03:55 por Ma Cristina | Informe spam
No se si estoy siendo logica.. por fa..diganme si alguien me entiende o no
para corregirlo y volverlo a hacer.. luego les digo lo que intento
conseguir.. porfa

public void recorrer()

{

Directory DirOrigen;

Directory DirDestino;

string archivo = @"*.xml";

if (Directory.Exists(DirOrigen))

{

if (!File.Exists(archivo))

{

File.Copy(DirDestino);

File.Delete();

}

}

}
 

Leer las respuestas

#1 Diego Jancic
25/05/2007 - 06:11 | Informe spam
mm
Creo que no entendi nada...
De hecho eso no compila:
1- Cuando haces if (Directory.Exists(DirOrigen)), el DirOrigen no esta
inicializado
2- File.Copy recive 2 parametros (que y a donde), no uno...
3- File.Delete() recive minimo un parametro (que queres borrar)
4- if (!File.Exists(archivo)), si bien la linea esta bien, creo que
"archivo" tendria que apuntar a un archivo especifico, no a un *.xml
5- File.Copy(DirDestino), DirDestino no esta inicializada..

Saludos,
Diego

Preguntas similares