用asp实现网页调用doc附Response.ContentType 详细列表

发布时间:2016-06-18 来源: 点击:

微软有篇文章:http://support.microsoft.com/kb/193998/zh-cn,用doc读取和显示二进制数据,《怎样读取二进制文件》,没测试,懒得编译dll

asp程序:

response.buffer=true

response.contenttype="application/x-msexcel"

dim   vntstream

set   oMyObject=server.createObject("MyObject.BinRead")'这个组件后面介绍

vntstream=oMyObject.readBinfile("c:\temp\tempxls.xls")

response.binarywrite(vntstream)

set   oMyObject.Nothing

response.end

%>

控件代码:

第一步:在VB中创建一个ActiveX   DLL   Project

第二步:把工程名改为MyObject

第三步:把class更名为BinRead

第四步:在class模块中写上以下代码

Function   readBinFile(ByVal   bfilename   As   String)

Dim   fl   As   Long

Dim   FileNum   As   Byte

Dim   binbyte()   As   String

FileNum   =   FreeFile

Open   bfilename   For   Binary   Access   Read   As   #FileNum

fl   =   FileLen(bfilename)

ReDim   binbyte(fl)

Get   #FileNum,   ,   binbyte

Close   #FileNum

readBinFile   =   binbyte

End   Function

第五步:存盘

第六步:编译

我的代码,不知为什么可以保存,在线打不开:

Response.Buffer   =   TRUE

response.ContentType="application/msword"

server.Execute("111.doc")

%>

附:

ASP:Response.ContentType 详细列表

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

代码如:

显示的为网页,而

则会显示html原代码.

以下为一些常用的 ContentType

GIF images

JPEG images

TIFF images

MICROSOFT WORD document

RTF document

MICROSOFT EXCEL document

MICROSOFT POWERPOINT document

PDF document

ZIP document

下面是更详细的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'

这就是微学网-程序员之家为你提供的"用asp实现网页调用doc附Response.ContentType 详细列表"希望对你有所帮助.本文来自网络,转载请注明出处:http://www.weixuecn.cn/article/2623.html

doc2html asp,用asp实现网页调用doc附Response.ContentType 详细列表相关推荐

  1. Response.ContentType 网页输出word excel 的格式

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

  2. java调用asp.net webapi_通过HttpClient 调用ASP.NET Web API示例

    在前面两篇文章中我们介绍了ASP.NET Web API的基本知识和原理,并且通过简单的实例了解了它的基本(CRUD)操作.我们是通过JQuery和Ajax对Web API进行数据操作.这一篇我们来介 ...

  3. ASP.NET获取任意网页HTML代码

    利用.NET的 WebClient类 和 WebRequest类,我们可以很容易地得到给定URL地址的源代码.主要代码如下: GetPage.aspx: 程序代码 <%@ Page Langua ...

  4. 【转】asp仿百度文库、豆丁doc转换(flashpaper)

    [转]asp仿百度文库.豆丁doc转换(flashpaper)     asp仿百度文库.豆丁doc转换(flashpaper)环境: flashpaper2.2版 win2008 IIS7 步骤: ...

  5. asp html表单没有csrf保护,ASP.NET MVC 和网页中的 XSRF/CSRF 防护

    ASP.NET MVC 和网页中的 XSRF/CSRF 防护 03/14/2013 本文内容 跨站点请求伪造(也称为 XSRF 或 CSRF)是一种针对 Web 托管型应用程序的攻击,恶意网站凭此可以 ...

  6. ajax html成功 asp,AJAX ASP

    AJAX ASP AJAX 被用于创建交互性更强的应用程序. AJAX ASP 实例 下面的实例将演示当用户在输入框中键入字符时,网页如何与 Web 服务器进行通信: 实例 Start typing ...

  7. ASP与ASP.NET的区别

    师姐开始学习asp了,昨天问了我asp与asp.net的区别,结果没回答好....太丢人了... ASP(Active Server Pages)是Microsfot公司1996年11月推出的WEB应 ...

  8. ASP.NET 2.0编程技巧之用Response对象输出图像

    一. 简介 作为ASP.NET基本对象之一的Response对象不但可以通过Write()方法直接在页面上输出字符串数据,而且还可以使用BinaryWrite()方法直接显示二进制表示的数据,如图像. ...

  9. 1月4日链接篇:ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, IIS7

    [原文地址]Jan 4th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, IIS7 [原文发表日期] Friday, Januar ...

最新文章

  1. Python的串口操作库pyserial
  2. 彻底搞懂机器学习中的正则化
  3. 从1到N,AI落地现在进行时
  4. fir滤波器c++程序_电气信息类专业课程之matlab系统仿真 第三章 滤波器的种类(1)...
  5. linux字体栅格化,响应式开发---网页的布局方式、媒体查询、栅格化布局、less语言...
  6. java 反射 父类的属性_用反射的方式获取父类中的所有属性和方法
  7. C语言编程新手自学手册下载,C语言编程新手自学手册
  8. vue 打包css路径不对_vue项目打包后css背景图路径不对的问题
  9. 从零开始撸一个ajax框架
  10. 常见路径规划算法介绍
  11. 基于FPGA的QAM调制
  12. html js post提交表单,JavaScript 实现POST方式提交表单
  13. 解决鼠标滚动时页面上下跳动的问题
  14. 最少的脚本实现在NSH脚本作业中加入动态参数
  15. 关于SQL Server中将数值类型转换为字符串的问题
  16. vscode 设置setting文件
  17. 作也 努力努力在努力
  18. others:南怀瑾先生讲:呵呼嘘吹嘻呬六字诀养生诀的要领---《南怀瑾与彼得圣吉》
  19. Unity3D游戏制作(一)——3D横版场景的角色移动控制
  20. 计算机组装职高必背,(完整word版)职高计算机组装与维护教案.doc

热门文章

  1. 教您快速学会用制表描点连线法画双曲线
  2. qt QCustomPlot学习
  3. Grab年亏36亿美元:半年市值蒸发超200亿美元 软银滴滴是股东
  4. stm32 read out protection
  5. 使用Linux版印象笔记nixnote2(安装以及启动)
  6. 使用docker搭建属于自己的网课系统
  7. js获取光标,设置光标位置
  8. 1.1.2_标准化工作及相关组织
  9. win7下 一键ghost/一键还原软件卸载后 删除相关开机启动选项
  10. 百度云服务器不同区域有什么区别?如何选择区域?