以前玩过一个游戏,输入两个人的名字然后点击缘分就能产生一段缘分测试的结果,后来经过分析知道是根据名字笔画数之差来弄的小游戏,于是就在百度上找怎么得到汉字的笔画数,也没找到自己想要的答案,问遍了所有的人也不知道怎么弄的,终于功夫不负有心人找到答案了,现在分享给大家!

第一步:添加DLL文件的引用

DLL下载地址:点此下载

第二步

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.International.Converters.PinYinConverter; namespace Example_CS
{
class Program
{
static void Main(string[] args)
{
ChineseChar chineseChar = new ChineseChar('微');
Console.WriteLine("Stroke number of 微 in Chinese is {0}.", chineseChar.StrokeNumber);
Console.WriteLine("{0} characters' pinyin is \"wei1\".", ChineseChar.GetHomophoneCount("wei1"));
if(ChineseChar.IsHomophone('微', '薇'))
{
Console.WriteLine("微 and 薇 have the same pinyin.");
}
else
{
Console.WriteLine("微 and 薇 have different pinyins.");
}
}
}
}

其中上面的属性和方法中:StrokeNumber属性用来获取字符的笔画数;

Pinyins方法

获取这个字符的拼音。

最新文章

  1. Python DES 加密解密,就是大家所谓想要的那个非常快速的方法
  2. Android安全之Https中间人攻击漏洞
  3. Notes of the scrum meeting(10/31)
  4. python模块之os和os.path模块
  5. Calendar - SGU 115(日期判断)
  6. JavaWeb图表插件的小研究
  7. Spring实战——Profile
  8. 消息映射(C++)(转)
  9. maven的web项目手工发布
  10. ssh相关命令
  11. c++中关于值对象与其指针以及const值对象与其指针的问题详细介绍
  12. js模块加载详解
  13. RESTful API接口文档规范小坑
  14. linux yum配置代理
  15. 【Unity】微软的一款依赖注入组件
  16. white-space:pre-wrap和word-break:break-all;
  17. Linux系统挂载Windows的共享文件夹
  18. Java:foreach实现原理
  19. kali网卡配置文件
  20. 在线图标制作,格式转换 ICON

热门文章

  1. php建立一个空类: stdClass
  2. go语言之并发编程一
  3. go语言之接口二
  4. [转载]Java web应用中的常见字符编码问题的解决方法
  5. JVM调优-工具篇
  6. python webserver客户端
  7. 【TFS】解决TFS编译中文乱码问题
  8. 什么是gevent
  9. [原创]java WEB学习笔记39:EL中的运算符号(算术运算符,关系运算符,逻辑运算符,empty运算符,条件运算符,括号运算符)
  10. [原创]java WEB学习笔记25:MVC案例完整实践(part 6)---新增操作的设计与实现