.net中的chr和asc函数实现(源代码)
/// <summary>
///将字符编码改成ASCII码
/// </summary>
/// <param name="CN">将要编码的字符串</param>
/// <returns>返回ASCII码</returns>
public string Chr(int N)
{
return Convert.ToChar(N).ToString();
}
/// <summary>
///将ASCII码改成字符编码
/// </summary>
/// <param name="S">将要编码的字符串</param>
/// <returns>返回字符编码</returns>
public int Asc(string S)
{
return Convert.ToInt16(Convert.ToChar(S));
}