zoukankan      html  css  js  c++  java
  • Response的Content Type的类型

    private string CheckType(string filename)
    {
        string ContentType;
        switch (filename.Substring(filename.LastIndexOf(".")).Trim().ToLower())
        {
            case ".asf ":
                ContentType = "video/x-ms-asf ";
                break;
            case ".avi ":
                ContentType = "video/avi ";
                break;
            case ".doc ":
                ContentType = "application/msword ";
                break;
            case ".zip ":
                ContentType = "application/zip ";
                break;
            case ".xls ":
                ContentType = "application/vnd.ms-excel ";
                break;
            case ".gif ":
                ContentType = "image/gif ";
                break;
            case ".jpg ":
                ContentType = "image/jpeg ";
                break;
            case "jpeg ":
                ContentType = "image/jpeg ";
                break;
            case ".wav ":
                ContentType = "audio/wav ";
                break;
            case ".mp3 ":
                ContentType = "audio/mpeg3 ";
                break;
            case ".mpg ":
                ContentType = "video/mpeg ";
                break;
            case ".mepg ":
                ContentType = "video/mpeg ";
                break;
            case ".rtf ":
                ContentType = "application/rtf ";
                break;
            case ".html ":
                ContentType = "text/html ";
                break;
            case ".htm ":
                ContentType = "text/html ";
                break;
            case ".txt ":
                ContentType = "text/plain ";
                break;
            default:
                ContentType = "application/octet-stream ";
                break;
        }
        return ContentType;
    }

  • 相关阅读:
    Android 通过solid来定义不同边框的颜色,可以只定义一个边框的颜色
    Java里的简单替换
    ActionBar
    char、short、int、float、double对应字节
    Java和JDK版本的关系-(转载)
    JFlash ARM对stm32程序的读取和烧录-(转载)
    STM32的时钟系统RCC详细整理(转载)
    STM32F7系列时钟相关问题:HSE模式配置(旁路模式、非旁路模式
    git OpenSSL SSL_connect问题
    keil使用VScode外部编辑器
  • 原文地址:https://www.cnblogs.com/windy2008/p/2610050.html
Copyright © 2011-2022 走看看