Пример #1
0
 public bool IsValid(HttpListenerRequest request)
 {
     if (request.HttpMethod == "POST")
     {
         var localFilePath = request.MapFilePath(directory);
         return Path.GetExtension(localFilePath) != string.Empty;
     }
     else
     {
         return false;
     }
 }
        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;
        }
        public bool IsValid(HttpListenerRequest request)
        {
            var localPath = request.MapFilePath(directory);

            return Directory.Exists(localPath);
        }
Пример #4
0
        public bool IsValid(HttpListenerRequest request)
        {
            if (request.HttpMethod != "GET") return false;

            var localFilePath = request.MapFilePath(directory);
            return File.Exists(localFilePath);
        }