Response.ContentType 详细列表-请求的内容类型详细记录
Response.ContentType 详细列表-请求的内容类型详细记录 作者:王春天
一、应用实例:
Response.Clear();
Response.ContentType = "text/html";//输出文件类型
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.AddHeader("Content-Disposition", "attachment; filename=" + "abc.html");//文件名
Response.Write("测试数据"); 二、不同的ContentType 会影响客户端所看到的效果.下面是一些常用的ContentType类型,默认的ContentType为 text/html 也就是网页格式.
代码如: response.ContentType ="text/html"
显示的为网页,而 response.ContentType ="text/plain"
则会显示html原代码. 以下为一些常用的 ContentType
GIF images 图片
response.ContentType ="image/gif" JPEG images 图片
response.ContentType ="image/jpeg" TIFF images 图片
response.ContentType ="image/tiff"
MICROSOFT WORD document response.ContentType ="application/msword"
RTF document
response.ContentType ="application/rtf"
MICROSOFT EXCEL document response.ContentType ="application/x-excel"
MICROSOFT POWERPOINT document response.ContentType ="application/ms-powerpoint"
PDF document
response.ContentType ="application/pdf"
ZIP document response.ContentType ="application/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 GetResourceSrc(string name)
{
System.Resources.ResourceManager rm = new ResourceManager("SNF.ResourceImg",
System.Reflection.Assembly.GetExecutingAssembly());//ResourceImg为资源文件名称,SNF//为命名空间
return rm.GetObject(name) as System.Drawing.Image;
} } 显示代码
protected void Page_Load(object sender, EventArgs e)
{ System.Drawing.Image img = SNF.GetImage.GetResourceSrc("_15958260");
//_15958260为在ResourceImg.resx资源管理窗口中看到资源图片名称 img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
Response.ContentType 详细列表-请求的内容类型详细记录的更多相关文章
- SharePoint 2013 图文开发系列之创建内容类型
SharePoint内容类型,是很有特色的,就好比发布新闻,同在一张列表里,可以由内容类型区分图片新闻.文字新闻等,顾名思义,就是在一张列表里发布不同类型的项目. 1.添加新项目,选择SharePoi ...
- MIME (Multipurpose Internet Mail Extensions) 是描述消息内容类型的因特网标准
http://www.alixixi.com/program/a/2010080364045.shtml MIME 消息能包含文本.图像.音频.视频以及其他应用程序专用的数据. 官方的 MIME 信息 ...
- Response.ContentType 详细列表 <转>
Response.ContentType 详细列表 不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式.代码如: <% ...
- 获取相应头信息Response Headers的内容类型Content-Type
Content-Type内容类型,也是键值对的形式: 我们在代码中获取: package com.zhi.httpClient2; import org.apache.http.Header; imp ...
- Response.ContentType 详细列表
不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式. 代码如: <% response.ContentType =&quo ...
- Response.ContentType 详细列表 (转载)
不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式.代码如: <% response.ContentType =" ...
- MIME 类型(HttpContext.Response.ContentType)列表
按照内容类型排列的 Mime 类型列表 类型/子类型 扩展名 application/envoy evy application/fractals fif application/futurespla ...
- 【转】【Asp.Net】ASP.Net Response.ContentType 详细列表
不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式. 代码如: <% response.ContentType =&quo ...
- 每日学习心得:SharePoint 为列表中的文件夹添加子项(文件夹)、新增指定内容类型的子项、查询列表中指定的文件夹下的内容
前言: 这里主要是针对列表中的文件下新增子项的操作,同时在新建子项时,可以为子项指定特定的内容类型,在某些时候需要查询指定的文件夹下的内容,针对这些场景都一一给力示例和说明,都是一些很小的知识点,希望 ...
随机推荐
- (转)NGUI类关系图
- jQuery cssHook的经典例子
/*--------------------------- example ------------------------------*/ $.cssHooks.foo = { get: fun ...
- cp 命令(转)
原文:http://www.cnblogs.com/peida/archive/2012/10/29/2744185.html cp命令用来复制文件或者目录,是Linux系统中最常用的命令之一.一般情 ...
- 算法笔记_193:历届试题 连号区间数(Java)
目录 1 问题描述 2 解决方案 1 问题描述 问题描述 小明这些天一直在思考这样一个奇怪而有趣的问题: 在1~N的某个全排列中有多少个连号区间呢?这里所说的连号区间的定义是: 如果区间[L, R ...
- 下载 jdk
1.下载JDK: 首先我们需要下载java开发工具包JDK,下载地址如下: http://www.oracle.com/technetwork/java/javase/downloads/index. ...
- openerp 7.0 来自外部的邮件会发送二次问题解决方法
插入代码:\addons\mail\mail_mail.py #309 line this = self.pool.get('res.users').browse(cr, uid, uid, cont ...
- python之函数用法basestring
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法basestring #http://www.cnblogs.com/oneday/a ...
- 2、classpath、path、JAVA_HOME的作用
windows xp下配置JDK环境变量: 1.安装JDK,安装过程中可以自定义安装目录等信息,例如我们选择安装目录为D:\java\jdk1.5.0_08: 2.安装完成后,右击“我的电脑”,点击“ ...
- openfire + spark 展示组织机构(客户端)
在spark 加一个插件用于展示组织机构, 参考了好多人的代码 插件主类增加一个 TAB用于展示机构树 package com.salesoa.orgtree; import java.net.URL ...
- Linux文件大小排序
ls 文件详情 ls -S / ###从大到小排序ls -Sr / ###从小到大排就加个-r -r 翻转ls -aSr / ...