0

私のコードはうまく機能していますが、「アイテム」と「モード」を暗号化された形式で送信したいと考えています。

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

2 に答える 2

1

暗号化またはエンコードされていますか?

文字列をエンコードするには、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.
于 2011-07-24T16:05:21.467 に答える