zoukankan      html  css  js  c++  java
  • Response 关于浏览器header的方法

    Response.AddHeader

     
    Response.AddHeader使用实例
    1.文件下载,指定默认名
    Response.AddHeader("content-type","application/x-msdownload");
    Response.AddHeader("Content-Disposition","attachment;filename=文件名.rar");
    2.刷新页面
    Response.AddHeader (“REFRESH”, ”60;URL=newpath/newpage.asp”)
    这等同于客户机端<META>元素:
    <META HTTP-EQUIV=”REFRESH”, “60;URL=newpath/newpage.asp”>
    3.页面转向
    Response.Status = “302 Object Moved”
    Response.Addheader “Location”, “newpath/newpage.asp”
    这等同于使用Response.Redirect方法:
    Response.Redirect “newpath/newpage.asp”
    4.强制浏览器显示一个用户名/口令对话框
    Response.Status= “401 Unauthorized”
    Response.Addheader “WWW-Authenticate”, “BASIC”
    强制浏览器显示一个用户名/口令对话框,然后使用BASIC验证把它们发送回服务器(将在本书后续部分看到验证方法)。
    5.如何让网页不缓冲
    Response.Expires = 0
    Response.ExpiresAbsolute = Now() - 1
    Response.Addheader "pragma","no-cache"
    Response.Addheader "cache-control","private"
    Response.CacheControl = "no-cache

    (转自百度百科

  • 相关阅读:
    SpringBoot 整合Shiro
    Shiro 学习
    SpringBoot 整合security、thymeleaf
    【SpringBoot__Mybatis】整合MyBatis 配置文件版2
    SpringBoot 配置Druid数据源及监控
    lombok 使用
    thymeleaf 常用
    随机模块
    md5加密
    python正则
  • 原文地址:https://www.cnblogs.com/zhangheng/p/3148606.html
Copyright © 2011-2022 走看看