原文发布时间为:2008-07-29 —— 来源于本人的百度文章 [由搬家工具导入]

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default5 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["name"]!=null&&Request.QueryString["age"]!=null)
        {
            Response.Write(Request.QueryString["name"] + "<br>" + Request.QueryString["age"]+"<br>");
            Response.Write(Request.RequestType);
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       // string d = Request.Form["name"];
       // string c = Request.Form["age"];

       string d = Request["name"];
       string c = Request["age"];

       Response.Write(d + "<br>" + c + "<br>");
       Response.Write(Request.RequestType);
       Response.Write("<br>"+"wang ye xu ni lujin:" + Request.RawUrl+"<br>");
       Response.Write("shi ji lujin:" + Request.PhysicalPath+ "<br>");
       Response.Write("IP:" + Request.UserHostAddress + "<br>");
       Response.Write("xi tong:" + Request.Browser.Platform+ "<br>");
       Response.Write("music" + Request.Browser.BackgroundSounds + "<br>");
       Response.Write("frames" + Request.Browser.Frames + "<br>");

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        HttpCookie nc = new HttpCookie("ck");
        nc.Values["name"] = "wuwenjie";
        nc.Values["age"] = "22";
        nc.Values["dt"] = DateTime.Now.ToString();
        Response.Cookies.Add(nc);
        Response.Write("success");

    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        HttpCookie getck = Request.Cookies["ck"];
        Response.Write(getck.Values["name"] + " " + getck.Values["age"] + " " + getck.Values["dt"]);
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://www.baidu.com");

    }
    protected void Button5_Click(object sender, EventArgs e)
    {
        Response.Write("<script>alert('nihao')</script>");
    }
    protected void Button6_Click(object sender, EventArgs e)
    {
        string xml = Server.MapPath("~/App_Data/XMLFile.xml").ToString();
        Response.WriteFile(xml);
    }
    protected void Button7_Click(object sender, EventArgs e)
    {    
        Response.Redirect("Default5.aspx?name=" + name.Text + "&age=" + age.Text);
    }
}

net1:post,get方式传值,读写cookie,读XML文件,写script语句,跳转页面,response与request类的更多相关文章

  1. ASP.NET通过http/https的POST方式,发送和接受XML文件内容

    本文转载:http://hi.baidu.com/ysyhyt/item/5011ae39ce3cf49fb80c0395 本文参考:http://blog.csdn.net/ououou123456 ...

  2. Qt读写三种文件,QSettings读ini配置文件,QJsonDocument读JSON文件,QDomDocument读xml文件

    第一种INI配置文件 .ini 文件是Initialization File的缩写,即初始化文件. 除了windows现在很多其他操作系统下面的应用软件也有.ini文件,用来配置应用软件以实现不同用户 ...

  3. LinqToXML~读XML文件

    linq的出现,带给我们的是简结,快速,可读性,它由linq to sql,linq to object,linq to XML组成,我的博客之前有对linq to sql的讲解,而今天,我将讲一个l ...

  4. C# xml 读xml、写xml、Xpath、Xml to Linq、xml添加节点 xml修改节点

    #region XDocument //创建XDocument XDocument xdoc2 = new XDocument(); XElement xel1= new XElement(" ...

  5. C#操作XML(读XML,写XML,更新,删除节点,与dataset结合等)【转载】

    已知有一个XML文件(bookstore.xml)如下: Corets, Eva 5.95 1.插入节点 往节点中插入一个节点: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...

  6. NOPI读xls文件写到txt中(NPOI系列二)

    private void button2_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); //找 ...

  7. [SAP ABAP开发技术总结]ABAP读写、解析XML文件

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  8. C# 读XML文件

    /// <summary> /// xml文件路径+名称 /// </summary> public void ReadXml(string xmlname) { try { ...

  9. java读XML文件

    XML文件设计为传输和存储数据,其焦点为数据内容. HTML设计为用来显示数据, 其焦点为数据外观. XML仅仅是文本文件,任何文本编辑器一般情况下都能对其进行编辑. XML没有预定义的标签,并且设定 ...

随机推荐

  1. github:Commit failed - exit code 1 received

    问题 使用github desktop 将项目提交到github,但提示Commit failed - exit code 1 received 开始以为名称过程,把名称改短,但还是失败. 原因 因为 ...

  2. 02_5if switch分支与循环语句

    02_5if switch分支与循环语句 1.语句 1.1条件语句-根据不同条件,执行不同语句. if if ... else if ... else if if ... else if ... el ...

  3. NSOperation、NSOperationQueue

    NSOperation.NSOperationQueue NSOperation 和 NSOperationQueue 配合使用也能实现多线程. NSOperation 继承于 NSObject,是一 ...

  4. 【python】python安装和运行报错汇总

    本文主要用于汇总在python开发过程中遇到的各种环境.工具相关问题,便于后续遇到相关问题,及时搞定,持续更新. 一.安装pip失败,具体如下: 错误信息: python setup.py insta ...

  5. SpringMVC 项目中引用其他 Module 中的方法

    1. 将要引用的Module 引入项目中 2. 在主Module中添加依赖, 3. 被引用的类必须放在 Module 中/src/下的某个package中,否则引用不到(重要)

  6. manjaro kde netease-cloud-music 网易云音乐

  7. 蓝牙nrf52832的架构和开发(转载)

    相比TI的CC254X.DIALOG的DA1458X,nordic推出的nrf51822和nrf52832在架构和开发商都有自己独特的地方.这几颗产品都是蓝牙低功耗芯片.DA1458X使用OTP硬件架 ...

  8. clr(Windows 运行时和公共语言运行时)

    Windows 运行时   编译器使用 COM 引用计数机制来确定对象是否不再使用并可以删除. 因为从 Windows 运行时接口派生的对象实际上是 COM 对象,所以这是可行的. 在创建或复制对象时 ...

  9. luogu2893 [USACO08FEB]修路Making the Grade

    ref #include <algorithm> #include <iostream> #include <cstring> #include <cstdi ...

  10. luogu3371 【模板】单源最短路径 dijkstra堆优化

    #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> ...