Response.AddHeader使用实例收集

文件下载,指定默认名

1 Response.AddHeader( " content-type " , " application/x-msdownload " );
2 Response.AddHeader( " Content-Disposition " , " attachment;filename=要下载的文件名.rar " );

刷新页面

1 Response.AddHeader “REFRESH”, ” 60 ;URL = newpath / newpage.asp” 
2 这等同于客户机端 < META > 元素: 
3 < META HTTP - EQUIV = ”REFRESH”, “ 60 ;URL = newpath / newpage.asp”

页面转向

1 Response.Status  =  “ 302   Object  Moved” 
2 Response.Addheader “Location”, “newpath / newpage.asp” 
3 这等同于使用Response.Redirect方法: 
4 Response.Redirect “newpath / newpage.asp”

强制浏览器显示一个用户名/口令对话

1 Response.Status =  “ 401  Unauthorized” 
2 Response.Addheader “WWW - Authenticate”, “BASIC” 
3 强制浏览器显示一个用户名 / 口令对话框,然后使用BASIC验证把它们发送回服务器(将在本书后续部分看到验证方法)。

如何让网页不缓冲

1Response.Expires = 0  
2Response.ExpiresAbsolute = Now() - 1
 
3Response.Addheader "pragma","no-cache"
 
4Response.Addheader "cache-control","private"
 
5Response.CacheControl = "no-cache

转载于:https://www.cnblogs.com/wwyup/archive/2008/02/10/1066543.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值