asp.Net学習RequestとResponseのその他の属性

1932 ワード

//Request
using System;

using System.Collections;

using System.Configuration;

using System.Data;

//using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

//using System.Xml.Linq;



public partial class ResponseOutput : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        Response.Clear();

        Response.Write("      ");

        for (int i = 0; i < 4; i++)

        {

            Response.Clear();

            Response.Write("       ~~" + i.ToString());

            //      

            if (i >= 2)

            {

                Response.Flush();

            }

            System.Threading.Thread.Sleep(1000);

        }

    }

}


//Response
using System;

using System.Collections;

using System.Configuration;

using System.Data;

//using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

//using System.Xml.Linq;



public partial class Reg : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Request.UrlReferrer != null)

        {

            //         

            string refferUri = Request.UrlReferrer.ToString();

            if (refferUri.IndexOf("google.com.hk") > -1)

            {

                //                     ,       

            }

            else

            {

            }

            Response.Write(refferUri);

            //             IP  

            Response.Write(Request.UserHostAddress);

        }

    }

}