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
前端学PHP之运算符
ASP.NET MVC的TextBoxFor()和TextBox()
在_Layout模版中使用@Styles.Render()没有效果
使用HTML.ActionLink实现一个图片链接
微软最有价值专家大中华峰会花絮视频
激活当前视图菜单高亮呈现
获取当前视图名
Razor语法中链接的一些方法
Razor语法的一些特殊需求输出