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
Maven的工程类型有哪些?
什么是Maven?
MyBatis 与 Hibernate 有哪些不同?
MySQL里有2000w数据,redis中只存20w的数据,如何保证redis中的数据都是热点数据?
使用过Redis做异步队列么,你是怎么用的?
我们怎样才能在动作类中获得Servlet API请求,响应,HttpSession等对象?
forward 和redirect的区别 ?
你所知道的微服务技术栈有哪些?请列举一二
SpringMVC流程?