public bool IsValid(HttpListenerRequest request)
        {
            if (request.HttpMethod != "GET")
            {
                return(false);
            }

            var localFilePath = request.MapFilePath(directory);

            return(File.Exists(localFilePath));
        }
示例#2
0
 public bool IsValid(HttpListenerRequest request)
 {
     if (request.HttpMethod == "POST")
     {
         var localFilePath = request.MapFilePath(directory);
         return(Path.GetExtension(localFilePath) != string.Empty);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
        public bool IsValid(HttpListenerRequest request)
        {
            var validHeader = request.HttpMethod == "DELETE" ||
                              request.Url.Query == "?delete" ||
                              request.Url.Query == "?remove";

            if (validHeader == false)
            {
                return(false);
            }

            var localFilePath = request.MapFilePath(directory);

            if (File.Exists(localFilePath) == false)
            {
                return(false);
            }

            return(true);
        }
示例#4
0
        public bool IsValid(HttpListenerRequest request)
        {
            var localPath = request.MapFilePath(directory);

            return(Directory.Exists(localPath));
        }