C#中如何获取汉字的笔画数和汉字的拼音
2011-11-02 23:04
471 查看
以前玩过一个游戏,输入两个人的名字然后点击缘分就能产生一段缘分测试的结果,后来经过分析知道是根据名字笔画数之差来弄的小游戏,于是就在百度上找怎么得到汉字的笔画数,也没找到自己想要的答案,问遍了所有的人也不知道怎么弄的,终于功夫不负有心人找到答案了,现在分享给大家!
第一步:添加DLL文件的引用
博客园的下载链接:http://files.cnblogs.com/zhangchao1988/%E6%B1%89%E5%AD%97DLL.zip
DLL下载地址:http://www.kuaipan.cn/file/id_26768907658330146.html 刚刚传到金山网盘的 你们看看能下载吗?不能下载或者有问题留下联系方式 我邮箱给你们!
第二步:
其中上面的属性和方法中:StrokeNumber属性用来获取字符的笔画数;
Pinyins方法
获取这个字符的拼音。
第一步:添加DLL文件的引用
博客园的下载链接:http://files.cnblogs.com/zhangchao1988/%E6%B1%89%E5%AD%97DLL.zip
DLL下载地址:http://www.kuaipan.cn/file/id_26768907658330146.html 刚刚传到金山网盘的 你们看看能下载吗?不能下载或者有问题留下联系方式 我邮箱给你们!
第二步:
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方法
获取这个字符的拼音。
相关文章推荐
- C#中如何获取汉字的笔画数和汉字的拼音
- C#获取汉字的拼音首字母帮助类库
- C# winform 获取汉字首字母拼音
- c#获取汉字的拼音首字母
- C#中实现输入汉字获取其拼音(汉字转拼音)的2种方法
- c# asp.net 2.0 获取汉字第一个拼音
- 《C#编程之道》 之 如何获取汉字的拼音首字母
- C# 获取汉字拼音首字母
- c# 根据中文汉字获取到拼音
- C# 获取汉字拼音首字母
- c#获取汉字的拼音首字母
- C#获取汉字字符串拼音首字母的方法
- C#获取汉字拼音
- c#中如何得到汉字的拼音首字母
- C# 获取汉字字串的拼音声母
- c#将中文转换成拼音,以空格隔开,全拼,获取汉字首字母,PinyinHelper
- 如何获取汉字的拼音
- C# 简体与繁体互转,汉字取拼音、笔画、读音
- C# 获取汉字拼音
- C# 获取汉字拼音首字母(修正)