繁体   English   中英

asp.net中的Request.QueryString

[英]Request.QueryString in asp.net

我的代码运行良好,但我想以加密形式发送“项目”和“模式”。任何在asp中内置的方法?

string url = "QueryStringRecipient.aspx?";
url += "Item=" + lstItems.SelectedItem.Text + "&";
url += "Mode=" + chkDetails.Checked.ToString();
Response.Redirect(url);

加密还是编码?

要编码字符串,有HttpServerUtility.UrlEncode

public string UrlEncode(
    string s
)

参数

s
    Type: System.String
    The text to URL-encode.

返回值

Type: System.String
The URL-encoded text.

解码HttpServerUtility.UrlDecode

public static string UrlDecode(
    string str
)

参数

str
    Type: System.String
    The string to decode.

返回值

Type: System.String
A decoded string.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM