您的位置:首页 > 编程语言 > ASP

自己写的asp.net网站在URL传值过程中隐藏真正值的方法

2011-08-09 22:33 344 查看
//传送值 

protected void btnsend_Click(object sender, EventArgs e)

    {

        string id, disguise, random;

        random = StrOperation.RandString();

        disguise = StrOperation.DisGuise();

        id = StrOperation.DeTransform3(txtID.Text.Trim().ToString());//StrOperation函数为上一篇博客中的方法集

        Response.Redirect("Show.aspx?type=" + id + "&target=" + random + "&id=" + disguise);

    }

//接收值

protected void Page_Load(object sender, EventArgs e)

    {

        if (Request.QueryString["type"] != null && Request.QueryString["type"].ToString() != "")

        {

            string id, code;

            code = Request.QueryString["type"].ToString();

            id = StrOperation.Transform3(code);

            lblID.Text = id;

        }

    }

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息