文件下載,指定默認(rèn)名
程序代碼
Response.AddHeader("content-type","application/x-msdownload");
Response.AddHeader("Content-Disposition","attachment;filename=要下載的文件名.rar");
刷新頁(yè)面
程序代碼
Response.AddHeader "REFRESH", "60;URL=newpath/newpage.asp"
等同于客戶機(jī)端<META>元素:
程序代碼
<META HTTP-EQUIV="REFRESH","60;URL=newpath/newpage.asp">
頁(yè)面轉(zhuǎn)向
程序代碼
Response.Status = "302 Object Moved"
Response.Addheader "Location", "newpath/newpage.asp"
等同于使用Response.Redirect方法:
程序代碼
Response.Redirect "newpath/newpage.asp"
強(qiáng)制瀏覽器顯示一個(gè)用戶名/口令對(duì)話框
程序代碼
Response.Status= "401 Unauthorized"
Response.Addheader "WWW-Authenticate", "BASIC"
強(qiáng)制瀏覽器顯示一個(gè)用戶名/口令對(duì)話框,然后使用BASIC驗(yàn)證把它們發(fā)送回服務(wù)器(將在本書(shū)后續(xù)部分看到驗(yàn)證方法)。
如何讓網(wǎng)頁(yè)不緩沖
程序代碼
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.Addheader "pragma","no-cache"
Response.Addheader "cache-control","private"
Response.CacheControl = "no-cache"
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。