public static int Asc(string character)
{
if (character.Length == 1)
{
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
int intAsciiCode = (int)asciiEncoding.GetBytes(character)[0];
return (intAsciiCode);
}
else
{
throw new Exception("Character is not valid.");
}
}
ASCII码转字符:
public static string Chr(int asciiCode)
{
if (asciiCode >= 0 && asciiCode <= 255)
{
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
byte[] byteArray = new byte[] { (byte)asciiCode };
string strCharacter = asciiEncoding.GetString(byteArray);
return (strCharacter);
}
else
{
throw new Exception("ASCII Code is not valid.");
}
}
0
0
WCF 第十二章 对等网 System.Net.PeerToPeer.Collaboration
WCF 第十二章 对等网 使用Windows Vista 来进行合作
WCF 第十二章 对等网 使用PNRP解决对等网络问题
WCF 第十二章 对等网 点对点应用程序
WCF 第十二章 对等网 限制一条消息的跳数
WCF 第十二章 对等网 创建P2P应用程序
C#解析HTML
C#中的DLL注入
VC简单实现淡入淡出效果