Response.ContentType 详细列表

Response.ContentType 详细列表Response.ContentType详细列表不同的ContentType会影响客户端所看到的效果.默认的ContentType为text/html也就是网页格式.代码如:显示的为网页,而则会显示html原代码.以下为一些常用的ContentTypeGIFimagesJPEG

大家好,又见面了,我是你们的朋友全栈君。



Response.ContentType 详细列表
Response.ContentType 详细列表

不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式.
代码如:

<% response.ContentType =”text/html” %>
<!–#i nclude virtual=”/ContentType.html” –>


显示的为网页,而

<% response.ContentType =”text/plain” %>
<!–#i nclude virtual=”/sscript/ContentType.html” –>


则会显示html原代码.

以下为一些常用的 ContentType
GIF images

<% response.ContentType =”image/gif” %>
<!–#i nclude virtual=”/myimage.gif” –>


JPEG images

<% response.ContentType =”image/jpeg” %>
<!–#i nclude virtual=”/myimage.jpeg” –>


TIFF images

<% response.ContentType =”image/tiff” %>
<!–#i nclude virtual=”/myimage.tiff” –>


MICROSOFT WORD document

<% response.ContentType =”application/msword” %>
<!–#i nclude virtual=”/myfile.doc” –>


RTF document

<% response.ContentType =”application/rtf” %>
<!–#i nclude virtual=”/myfile.rtf” –>


MICROSOFT EXCEL document

<% response.ContentType =”application/x-excel” %>
<!–#i nclude virtual=”/myfile.xls” –>


MICROSOFT POWERPOINT document

<% response.ContentType =”application/ms-powerpoint” %>
<!–#i nclude virtual=”/myfile.pff” –>


PDF document

<% response.ContentType =”application/pdf” %>
<!–#i nclude virtual=”/myfile.pdf” –>


ZIP document

<% response.ContentType =”application/zip” %>
<!–#i nclude virtual=”/myfile.zip” –>

下面是更详细的ContentType
‘ez’ => ‘application/andrew-inset’,
‘hqx’ => ‘application/mac-binhex40’,
‘cpt’ => ‘application/mac-compactpro’,
‘doc’ => ‘application/msword’,
‘bin’ => ‘application/octet-stream’,
‘dms’ => ‘application/octet-stream’,
‘lha’ => ‘application/octet-stream’,
‘lzh’ => ‘application/octet-stream’,
‘exe’ => ‘application/octet-stream’,
‘class’ => ‘application/octet-stream’,
‘so’ => ‘application/octet-stream’,
‘dll’ => ‘application/octet-stream’,
‘oda’ => ‘application/oda’,
‘pdf’ => ‘application/pdf’,
‘ai’ => ‘application/postscript’,
‘eps’ => ‘application/postscript’,
‘ps’ => ‘application/postscript’,
‘smi’ => ‘application/smil’,
‘smil’ => ‘application/smil’,
‘mif’ => ‘application/vnd.mif’,
‘xls’ => ‘application/vnd.ms-excel’,
‘ppt’ => ‘application/vnd.ms-powerpoint’,
‘wbxml’ => ‘application/vnd.wap.wbxml’,
‘wmlc’ => ‘application/vnd.wap.wmlc’,
‘wmlsc’ => ‘application/vnd.wap.wmlscriptc’,
‘bcpio’ => ‘application/x-bcpio’,
‘vcd’ => ‘application/x-cdlink’,
‘pgn’ => ‘application/x-chess-pgn’,
‘cpio’ => ‘application/x-cpio’,
‘csh’ => ‘application/x-csh’,
‘dcr’ => ‘application/x-director’,
‘dir’ => ‘application/x-director’,
‘dxr’ => ‘application/x-director’,
‘dvi’ => ‘application/x-dvi’,
‘spl’ => ‘application/x-futuresplash’,
‘gtar’ => ‘application/x-gtar’,
‘hdf’ => ‘application/x-hdf’,
‘js’ => ‘application/x-javascript’,
‘skp’ => ‘application/x-koan’,
‘skd’ => ‘application/x-koan’,
‘skt’ => ‘application/x-koan’,
‘skm’ => ‘application/x-koan’,
‘latex’ => ‘application/x-latex’,
‘nc’ => ‘application/x-netcdf’,
‘cdf’ => ‘application/x-netcdf’,
‘sh’ => ‘application/x-sh’,
‘shar’ => ‘application/x-shar’,
‘swf’ => ‘application/x-shockwave-flash’,
‘sit’ => ‘application/x-stuffit’,
‘sv4cpio’ => ‘application/x-sv4cpio’,
‘sv4crc’ => ‘application/x-sv4crc’,
‘tar’ => ‘application/x-tar’,
‘tcl’ => ‘application/x-tcl’,
‘tex’ => ‘application/x-tex’,
‘texinfo’ => ‘application/x-texinfo’,
‘texi’ => ‘application/x-texinfo’,
‘t’ => ‘application/x-troff’,
‘tr’ => ‘application/x-troff’,
‘roff’ => ‘application/x-troff’,
‘man’ => ‘application/x-troff-man’,
‘me’ => ‘application/x-troff-me’,
‘ms’ => ‘application/x-troff-ms’,
‘ustar’ => ‘application/x-ustar’,
‘src’ => ‘application/x-wais-source’,
‘xhtml’ => ‘application/xhtml+xml’,
‘xht’ => ‘application/xhtml+xml’,
‘zip’ => ‘application/zip’,
‘au’ => ‘audio/basic’,
‘snd’ => ‘audio/basic’,
‘mid’ => ‘audio/midi’,
‘midi’ => ‘audio/midi’,
‘kar’ => ‘audio/midi’,
‘mpga’ => ‘audio/mpeg’,
‘mp2’ => ‘audio/mpeg’,
‘mp3’ => ‘audio/mpeg’,
‘aif’ => ‘audio/x-aiff’,
‘aiff’ => ‘audio/x-aiff’,
‘aifc’ => ‘audio/x-aiff’,
‘m3u’ => ‘audio/x-mpegurl’,
‘ram’ => ‘audio/x-pn-realaudio’,
‘rm’ => ‘audio/x-pn-realaudio’,
‘rpm’ => ‘audio/x-pn-realaudio-plugin’,
‘ra’ => ‘audio/x-realaudio’,
‘wav’ => ‘audio/x-wav’,
‘pdb’ => ‘chemical/x-pdb’,
‘xyz’ => ‘chemical/x-xyz’,
‘bmp’ => ‘image/bmp’,
‘gif’ => ‘image/gif’,
‘ief’ => ‘image/ief’,
‘jpeg’ => ‘image/jpeg’,
‘jpg’ => ‘image/jpeg’,
‘jpe’ => ‘image/jpeg’,
‘png’ => ‘image/png’,
‘tiff’ => ‘image/tiff’,
‘tif’ => ‘image/tiff’,
‘djvu’ => ‘image/vnd.djvu’,
‘djv’ => ‘image/vnd.djvu’,
‘wbmp’ => ‘image/vnd.wap.wbmp’,
‘ras’ => ‘image/x-cmu-raster’,
‘pnm’ => ‘image/x-portable-anymap’,
‘pbm’ => ‘image/x-portable-bitmap’,
‘pgm’ => ‘image/x-portable-graymap’,
‘ppm’ => ‘image/x-portable-pixmap’,
‘rgb’ => ‘image/x-rgb’,
‘xbm’ => ‘image/x-xbitmap’,
‘xpm’ => ‘image/x-xpixmap’,
‘xwd’ => ‘image/x-xwindowdump’,
‘igs’ => ‘model/iges’,
‘iges’ => ‘model/iges’,
‘msh’ => ‘model/mesh’,
‘mesh’ => ‘model/mesh’,
‘silo’ => ‘model/mesh’,
‘wrl’ => ‘model/vrml’,
‘vrml’ => ‘model/vrml’,
‘css’ => ‘text/css’,
‘html’ => ‘text/html’,
‘htm’ => ‘text/html’,
‘asc’ => ‘text/plain’,
‘txt’ => ‘text/plain’,
‘rtx’ => ‘text/richtext’,
‘rtf’ => ‘text/rtf’,
‘sgml’ => ‘text/sgml’,
‘sgm’ => ‘text/sgml’,
‘tsv’ => ‘text/tab-separated-values’,
‘wml’ => ‘text/vnd.wap.wml’,
‘wmls’ => ‘text/vnd.wap.wmlscript’,
‘etx’ => ‘text/x-setext’,
‘xsl’ => ‘text/xml’,
‘xml’ => ‘text/xml’,
‘mpeg’ => ‘video/mpeg’,
‘mpg’ => ‘video/mpeg’,
‘mpe’ => ‘video/mpeg’,
‘qt’ => ‘video/quicktime’,
‘mov’ => ‘video/quicktime’,
‘mxu’ => ‘video/vnd.mpegurl’,
‘avi’ => ‘video/x-msvideo’,
‘movie’ => ‘video/x-sgi-movie’,
‘ice’ => ‘x-conference/x-cooltalk’

//———————下面是从资源文件获取图片。并显示
 public class GetImage
    {

        public static System.Drawing.Image GetSrc(string name)
        {

            System.Resources.ResourceManager rm = new ResourceManager(“ClassLibrary.ResourceTestImg”,
       System.Reflection.Assembly.GetExecutingAssembly());//ResourceTestImg为资源文件名称,ClassLibrary//为命名空间
            return rm.GetObject(name) as System.Drawing.Image;
        }
      
    }

显示代码
 protected void Page_Load(object sender, EventArgs e)
 {

            System.Drawing.Image img = ClassLibrary.GetImage.GetSrc(“_15958260”);
           //_15958260为在ResourceTestImg.resx资源管理窗口中看到资源图片名称
                     
            img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/161627.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Java面向对象编程三大特征 – 封装

    Java面向对象编程三大特征 – 封装本文关键字:Java、面向对象、三大特征、封装。封装是面向对象编程中的三大特征之一,在对封装性进行解释时我们有必要先了解一些面向对象的思想,以及相关的概念。

    2022年7月25日
    3
  • 正则化的作用以及L1和L2正则化的区别

    正则化的作用以及L1和L2正则化的区别0正则化的作用正则化的主要作用是防止过拟合,对模型添加正则化项可以限制模型的复杂度,使得模型在复杂度和性能达到平衡。常用的正则化方法有L1正则化和L2正则化。L1正则化和L2正则化可以看做是损失函数的惩罚项。所谓『惩罚』是指对损失函数中的某些参数做一些限制。L1正则化的模型建叫做Lasso回归,使用L2正则化的模型叫做Ridge回归(岭回归。但是使用正则化来防止过拟合的原理是什么?L1和L…

    2022年7月13日
    12
  • Python之numpy库

    NumPy库知识结构

    2021年12月19日
    37
  • cifar10数据集下载及图片格式解析

    cifar10数据集下载及图片格式解析CIFAR-10是由Hinton的学生AlexKrizhevsky和IlyaSutskever整理的一个用于识别普适物体的小型数据集。一共包含10个类别的RGB彩色图片:飞机(a叩lane)、汽车(automobile)、鸟类(bird)、猫(cat)、鹿(deer)、狗(dog)、蛙类(frog)、马(horse)、船(ship)和卡车(truck)。图片的尺寸为32×32×3,数据集中一共有50…

    2022年6月22日
    41
  • REST API和SOAP API区别[通俗易懂]

    REST API和SOAP API区别[通俗易懂]RESTAPI优点:1.轻量级的解决方案,不必向SOAP那样要构建一个标准的SOAPXML。2.可读性比较好:可以把URL的名字取得有实际意义。3.不需要SDK支持:直接一个Http请求就可以,但是SOAP则可能需要使用到一些Webservice的类库(例如Apache的Axis)缺点:1.复杂的应用中,URL可能非常长,而且不容易解析。SOAPAPI优点:1.定…

    2022年7月13日
    29
  • 合理的基尼系数_基尼系数为1表示

    合理的基尼系数_基尼系数为1表示一、基尼指数的概念基尼指数(Gini不纯度)表示在样本集合中一个随机选中的样本被分错的概率。注意:Gini指数越小表示集合中被选中的样本被参错的概率越小,也就是说集合的纯度越高,反之,集合越不纯。当集合中所有样本为一个类时,基尼指数为0.二、基尼系数的计算公式基尼指数的计算公式为:三、计算示例我们分别来计算一下决策树中各个节点基尼系数:以下excel表格记录了Gini系数的计算过程。我们可以看到,GoodBloodCircle的基尼系数是最小的,也就是最不容易犯错误,因此我们应该把这个

    2022年10月13日
    0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号