标签:des io os java ar sp on c 代码
开始编/解码前,需要引入命名空间 using System.Text;
编码按钮代码:
protected void BtnPWD_Click(object sender, EventArgs e)
{
if (this.TxtStr.Text == "")
{
Response.Write("<script language=javascript>alert(‘对不起,文本框为空‘);location=‘javascript:history.go(-1)‘</script>");
}
else
{
string Str = this.TxtStr.Text;
string UrlEncodeStr = Server.UrlEncode(Str);
this.Label1.Text = "编码为:" + UrlEncodeStr.ToString();
}
}
解码按钮代码:
请参考上面代码,将Server.UrlEncode(Str)改为Sever.UrlDecode(Str);
标签:des io os java ar sp on c 代码
原文地址:http://www.cnblogs.com/hbhssm/p/3991365.html