文件下載,指定默認名
程序代碼
Response.AddHeader("content-type","application/x-msdownload");
Response.AddHeader("Content-Disposition","attachment;filename=要下載的文件名.rar");
刷新頁面
程序代碼
Response.AddHeader "REFRESH", "60;URL=newpath/newpage.ASP"
等同於客戶機端<META>元素:
程序代碼
<META HTTP-EQUIV="REFRESH","60;URL=newpath/newpage.ASP">
頁面轉向
程序代碼
Response.Status = "302 Object Moved"
Response.Addheader "Location", "newpath/newpage.ASP"
等同於使用Response.Redirect方法:
程序代碼
Response.Redirect "newpath/newpage.ASP"
強制浏覽器顯示一個用戶名/口令對話框
程序代碼
Response.Status= "401 Unauthorized"
Response.Addheader "WWW-Authenticate", "BASIC"
強制浏覽器顯示一個用戶名/口令對話框,然後使用BASIC驗證把它們發送回服務器(將在本書後續部分看到驗證方法)。
如何讓網頁不緩沖
程序代碼
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.Addheader "PRagma","no-cache"
Response.Addheader "cache-control","private"
Response.CacheControl = "no-cache"