Foros del Web » Programación para mayores de 30 ;) » .NET »

Eliminar Archivo con File - File does not exist

Estas en el tema de Eliminar Archivo con File - File does not exist en el foro de .NET en Foros del Web. Hey Guys, I'm working on a webapplication and I'm saving files .pdf in a folder called "Files" inside of the application project... So, I display ...
  #1 (permalink)  
Antiguo 10/07/2011, 10:36
 
Fecha de Ingreso: noviembre-2010
Mensajes: 2
Antigüedad: 13 años, 5 meses
Puntos: 0
Eliminar Archivo con File - File does not exist

Hey Guys,

I'm working on a webapplication and I'm saving files .pdf in a folder called "Files" inside of the application project...

So, I display these pdf files but I got a nasty problem, with delete them, It's driving me nuts....

because I every time I try to do it, I get this exception:

"File does not exist", It couldn't be found... BUT the goddamned File does exist..

In fact, I display this pdf file (with response.transmitfile) with the same string path and It works... but when I try to delete it with the methos from IO.. It doesn't work at all..

Here' part my code:

string path = @"\Files" + "\\" +filename.pdf;
if (File.Exists(path))
{

File.Delete(path);



elimino = true;
}

So, anybody knows how can I solve this problem???

Thanks...

Etiquetas: exist, file
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:48.