Url简单编码

1 .加密。 

  Response.Redirect( " DetailInfo.aspx?id= "   +  Convert.ToBase64String(System.Text.Encoding.Default.GetBytes( " sp10006 " )).Replace( " + " , " %2B " ));

   2 .解密。

   string  ID  =  System.Text.Encoding.Default.GetString(Convert.FromBase64String(Request.QueryString[ " id " ].ToString().Replace( " %2B " , " + " )));

你可能感兴趣的:(url)