• 获取服务器信息


    浏览者操作系统的默认语言
    Request.ServerVariables.Get("HTTP_ACCEPT_LANGUAGE")
    客户端ip:
    Request.ServerVariables.Get("Remote_Addr");
    客户端主机名:
    Request.ServerVariables.Get("Remote_Host");
    服务器ip:
    Request.ServerVariables.Get("Local_Addr");
    服务器名:
    Request.ServerVariables.Get("Server_Name");
    获得用户登陆名
    Request.ServerVariables.Get("LOGON_USER");
    //获取服务器环境变量
    Response.Write("当前网页虚拟路径是:"+Request.RawUrl);
    Response.Write("<br>实际路径:"+Request.PhysicalPath);
    Response.Write("<br>服务器名:" + Request.ServerVariables["server_name"]);
    Response.Write("<br>服务器IP:" + Request.UserHostAddress);
    //获取浏览器环境变量
    Response.Write("这个浏览器是否支持背景音乐:" + Request.Browser.BackgroundSounds); Response.Write("这个浏览器是否支持框架:" + Request.Browser.Frames);
    Response.Write("客户用的什么系统:" + Request.Browser.Platform);
    //写入cookie
    HttpCookie hc = new HttpCookie("newcookie");
    hc.Values["name"] = "冰冰";
    hc.Values["age"] = "22";
    hc.Values["date"] = DateTime.Now.ToString();
    Response.Cookies.Add(hc);
    Response.Write("cookie写入成功!");
    //读取cookie
    HttpCookie getcook=Request.Cookies["newcookie"];
    Response.Write(getcook.Values["name"]);
    Response.Write("<br>"+getcook.Values["age"]);
    Response.Write("<br>"+getcook.Values["date"]);

  • 相关阅读:
    javascript定义变量和优先级的问题
    css expression explaination
    apply()与call()详解
    jquery $(document).ready() 与window.onload的区别
    ES5严格模式
    css margin collapse
    作业 20181016-10 每周例行报告
    作业 20181009-9 每周例行报告
    作业 20180925-1 每周例行报告
    20180925-7 规格说明书-吉林市2日游
  • 原文地址:https://www.cnblogs.com/zxktxj/p/2491429.html
Copyright © 2020-2023  润新知