Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/08/2013, 09:40
Avatar de guichogdl
guichogdl
 
Fecha de Ingreso: abril-2010
Ubicación: gdl
Mensajes: 131
Antigüedad: 15 años
Puntos: 1
Pregunta Error 500 por llamar a Server.MapPath desde WebMethod

Hola que tal, tengo un problema en un WebMethod, desde donde necesito borrar un archivo que se encuentra en una carpeta dentro del servidor, pero al invocar a
Server.MapPath(path_servidor) me genera un

500 (Internal Server Error) asp.net

Código PHP:

[WebMethod]
public static 
string obtenerNombreArchivo(string n) {

       
Directorio a = new Directorio();
       return 
a.deleteArchivo(n);
}


public 
string deleteArchivo(string archivo){

       
string mensaje="";
       
string path_servidor "/Respaldo/";
       
aborrar Server.MapPath(path_servidor) + archivo

        if (
File.Exists(aborrar){
           
             
File.Delete(aborrar);
             
mensaje "ok";
       }
        else{
             
mensaje "ok";
        }
        
        return 
mensaje;


Gracias de antemano quien pueda ayudarme como puedo invocar este codigo desde el webmethod

Saludos