Server.Request.MapMIMEType C# (CSharp) Méthode

MapMIMEType() private static méthode

private static MapMIMEType ( string filePath, string type ) : string
filePath string
type string
Résultat string
        private static string MapMIMEType(string filePath, string type)
        {
            switch (GetFileExtentsion(filePath)) {
                case "css":
                    type = "text/css";
                    break;
                case "xml":
                case "xsl":
                    type = "text/xml";
                    break;
                case "jpg":
                case "jpeg":
                    type = "image/jpeg";
                    break;
                case "gif":
                    type = "image/gif";
                    break;
                    // Not exhaustive. Extend this list as required.
            }
            return type;
        }