实现效果:

关键知识:

实现代码:

     private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text != string.Empty) {//不为空
if (Encoding.GetEncoding("unicode").//判断字是否为字符
GetBytes(new char[] { textBox1.Text[] })[] == )
{ //转ASCII
textBox2.Text = Encoding.GetEncoding("unicode").
GetBytes(textBox1.Text)[].ToString();
}
else {
textBox1.Text = string.Empty;
MessageBox.Show("请输入正确字母");
}
}
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox3.Text != string.Empty) {
int temp;
if (int.TryParse(textBox3.Text, out temp))
{ //转换字符
textBox4.Text = ((char)temp).ToString();
}
else {
textBox1.Text = string.Empty;
MessageBox.Show("请输入正确数字");
}
}
}

字符ASCII转换的更多相关文章

  1. JS 字符ASCII转换

    var a="1368628429"; String.fromCharCode( a.substring(a.length-1,1).charCodeAt())=>" ...

  2. 【jquery】字符ascii码转换函数

    js 字符ascii码转换函数 字符转ascii码:用charCodeAt();ascii码砖字符:用fromCharCode(); 看一个小例子 <script> str="A ...

  3. iconv字符编码转换

    转自 http://blog.csdn.net/langresser_king/article/details/7459367 iconv(http://www.gnu.org/software/li ...

  4. unicode编码、字符的转换和得到汉字的区位码

    一:unicode编码.字符的转换截图 二:unicode编码.字符的转换代码 using System; using System.Collections.Generic; using System ...

  5. python模块介绍- binascii 二进制和ASCII转换

    python模块介绍-binascii二进制和ASCII转换 目录 项目简介 简介: Uu编码 Binhex编码 Base64编码 QP码 CRC校验和 二进制转换 其他实例 项目简介 Python中 ...

  6. php字符编码转换之gb2312转为utf8(转)

    在php中字符编码转换我们一般会用到iconv与mb_convert_encoding进行操作,但是mb_convert_encoding在转换性能上比iconv要差很多哦.string iconv ...

  7. python文本 字符与字符值转换

    python文本 字符与字符值转换 场景: 将字符转换成ascii或者unicode编码 在转换过程中,注意使用ord和chr方法 >>> print(ord('a'))    97 ...

  8. python字符编码转换说明及深浅copy介绍

    编码说明: 常用编码介绍: ascii 数字,字母 特殊字符. 字节:8位表示一个字节. 字符:是你看到的内容的最小组成单位. abc : a 一个字符. 中国:中 一个字符. a : 0000 10 ...

  9. day4学python 字符编码转换+元组概念

    字符编码转换+元组概念 字符编码转换 #coding:gbk //此处必声明 文件编码(看右下角编码格式) #用来得到python默认编码 import sys print(sys.getdefaul ...

随机推荐

  1. java连接redis使用jedis带密码

    一.引入jedis的Maven配置文件 <!-- redis连接客户端jedis --> <dependency> <groupId>redis.clients&l ...

  2. poj 1080 ——Human Gene Functions——————【最长公共子序列变型题】

    Human Gene Functions Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17805   Accepted:  ...

  3. js判断下拉框改变状态

    <script> $('#questSort').change(function(){ //此处写状态改变要实现的功能 var s=$('#questSort').children('op ...

  4. mvc 中Request[""]与Request.QueryString[""]

    1.Request[""]与Request.QueryString[""]获取不到值时返回null: 2.Request[""]与Reque ...

  5. 集合异常之List接口

    List接口介绍:是Collection接口中的子类, 特点: l  它是一个元素存取有序的集合.例如,存元素的顺序是11.22.33.那么集合中,元素的存储就是按照11.22.33的顺序完成的).( ...

  6. Django——admin管理工具

    一.admin组件使用 Django 提供了基于 web 的管理工具. Django 自动管理工具是 django.contrib 的一部分.你可以在项目的 settings.py 中的 INSTAL ...

  7. 首页的css

    html,body{ margin:; padding:; background-color: lavenderblush; } a{ color:darkgray; } li{ list-style ...

  8. 【数据库】7.0 MySQL入门学习(七)——MySQL基本指令:帮助、清除输入、查询等

    1.0 help == ? 帮助指令,查询某个指令的解释.用法.说明等.详情参考博文: [数据库]6.0 MySQL入门学习(六)——MySQL启动与停止.官方手册.文档查询 https://www. ...

  9. eclipse中手动设置library,选择编译工具方法

    target=android-25sdk.buildtools=25.0.2 target=android-26android.library=falseandroid.library.referen ...

  10. IEEP-网络设计

    IEEP-网络设计 网络设计概述 网络设计概述 1.负责把网络规划阶段获得的客户需求运用技术手段予以规范化体现 2.网络设计一般遵循模块化指导方针,分模块进行设计 3.网络设计的输出成果必须是规范的. ...