public int Asc(string character) /*字符转化为ASCII*/
{
if ( == 1)
{
asciiEncoding = new ();
int intAsciiCode = (int)(character)[0];
return (intAsciiCode);
}
else
{
throw new Exception("Character is not valid.");
}
}
public string Chr(int asciiCode) /*ASCII 转化为 字符*/
{
if (asciiCode >= 0 && asciiCode <= 255)
{
asciiEncoding = new ();
byte[] byteArray = new byte[] { (byte)asciiCode };
string strCharacter = (byteArray);
return (strCharacter);
}
else
{
throw new Exception("ASCII Code is not valid.");
}
}