惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 好窝

SQL Server 日期和时间函数 面试谈离职 技巧很重要 服务器应用程序不可用 Scripting.FileSystemObject 的文件复制,删除,移动操作 - 好窝 - 博客园 刷新框架网页七种方法 asp套打位置 三层结构 RecordSet中的open完全的语法 域名删除时间及whois状态说明 把书看薄,再看厚 ContentType类型 使用Request.Servervariables("HTTP_USER_AGENT")取值 HTTP_X_FORWARDED_FOR & REMOTE_ADDR HTTP 头已经写入到客户浏览器。任何HTTP 头的修改必须在写入页内容之前。 使用获取url中的文件名和传过来的值 Response.AddHeader使用实例收集 怎么重启IIS 笔记本键盘设置 安装SQL2000时提示错误:以前的某个程序安装己在安装计算机上创建挂起的文件操作
Response.ContentType
好窝 · 2008-02-10 · via 博客园 - 好窝

Response.ContentType 是用来控制输出的文件类型的。
服务器送给客户端的数据包类型可以是text/html文本,也可以是gif/jpeg图形文件,所以每次传输前,我们都必须告知客户端将要传输的文件类型,一般默认情况下为“Text/Html”类型。

1<% Response.ContentType = "text/HTML" %>
2<% Response.ContentType = "image/GIF" %>
3<% Response.ContentType = "image/JPEG" %>

用于作为文本内容返回而不是已解释的 HTML 语句
Response.ContentType = "text/plain"

1<
2Response.ContentType = "text/plain" 
3Response.write(now()&"会被执行么?")
4%>

你可以注意到:页面提供下载,页面中的ASP内容被解释执行了的程序文件以XLS文件被提供下载
Response.ContentType = "application/vnd.ms-excel"

1<%
2Response.ContentType = "application/vnd.ms-excel"
3Response.write("本页面调试会出现下载对话框提供下载,保存类型为XLS")
4%>

实现歌曲连续播放
response.ContentType="audio/x-pn-realaudio"

 1<%
 2Dim ramstr 
 3ramstr="" 
 4Set rs=Server.CreateObject("Adodb.RecordSet"
 5sql="XXXXXXXXXXX" 
 6rs.open sql,conn,1,3 'conn已定义 
 7Do While Not rs.eof 
 8ramstr=ramstr&rs("url")&vbCrLf 
 9rs.MoveNext 
10loop
11rs.Close 
12Response.ContentType="audio/x-pn-realaudio" 
13'response.ContentType="audio/x-mpegurl" 
14Response.Write ramstr 
15%>

response.write 输出的时候,由于定义了response.ContentType 所以输出歌曲地址的时候会自动调用符合相应格式的软件来播放歌曲,不过前提是播放歌曲的软件必须先安装的。response.write 输出的时候,由于定义了response.ContentType 所以输出歌曲地址的时候会自动调用符合相应格式的软件来播放歌曲,不过前提是播放歌曲的软件必须先安装的。

 <% Response.charset="GB2312" %>