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;
    }

  • 相关阅读:
    SQL SERVER 实现多个数据库之间表的联系,利用临时表枚举表中行数据
    [CCF CSP]201909-2 小明种苹果(续)
    Anaconda 安装 Python 库(MySQLdb)
    [CCF CSP]201903-4 消息传递接口
    [CCF CSP]201609-4 交通规划
    2019年12月CSP考试第三题化学方程式解法
    Leetcode.94.二叉树的中序遍历
    GENIA命名实体数据集解析代码
    git添加新用户
    C#语言 十大经典排序算法动画与解析!(动态演示+代码)(java改写成C# )
  • 原文地址:https://www.cnblogs.com/windy2008/p/2610050.html
Copyright © 2011-2022 走看看