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

  • 相关阅读:
    minixml3.1库的使用
    linux coredump及函数栈空间大小分析
    linx 设备名字来由 sd sr sg st
    gcc 遇到过的语法问题
    I帧、B帧、P帧、NALU类型
    linux grub 使用
    结构体sockadrr、sockaddr_in、in_addr的定义
    linux c log 日志接口
    关于32位/64位版本头文件的重要
    汇编指令缩写
  • 原文地址:https://www.cnblogs.com/windy2008/p/2610050.html
Copyright © 2011-2022 走看看