///<summary>
///< functions: Encode>
///Effect: Converts a string content into a 16-encoded data encoding, which is the reverse process decode
///parameter description:
/// Strencode the original string that needs to be transformed
///the process of converting a character directly into a Unicode character, such as the number "3"-->0033, the Chinese character "I"-->u+6211
/// The process of function decode is the inverse process of encode.
///</summary>
///<param name= "Strencode" ></PARAM>
///<returns></returns
public static string Encode (String strencode)
{
string strreturn = "";// Store converted encoding
foreach (Short shortx in Strencode.tochararray ())
{
Strreturn + = Shortx. ToString ("X4");
}
return strreturn;
}
///<summary>
///< functions: Decode>
///role: Converting 16-encoded data into a string is a encode inverse procedure
///</summary>
///<param name= "Strdecode" ></PARAM>
///<returns></returns>
public static string Decode (String strdecode)
{
string sresult = ";
for (int i = 0; i < STRDECODE.LENGTH/4 i++)
{
&NBSP;&NBSP;&NBSP;&NBSP;&N bsp; Sresult + = (char) short. Parse (Strdecode.substring (i * 4, 4), global::system.globalization.numberstyles.hexnumber);
}
return sresult;
}