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

  • 相关阅读:
    如何量化用户体验UE(How To Quantify The User Experience)[网摘]
    完美简单的loading外部文件.
    FLV播放器 源码二例
    让你的网站上实时更新各大网站的新闻
    我的第一次涂鸦
    Alan Cooper 的交互设计观 [网摘]
    把视频文件自动的在服务器端转换成FLV文件的FFMPEG的编译方法[网摘]
    ASP.NET 页面生命周期
    ASP.NET MVC Area操作
    浅谈DataAnnotations
  • 原文地址:https://www.cnblogs.com/windy2008/p/2610050.html
Copyright © 2011-2022 走看看