使用 Microsoft Visual Studio International Pack 1.0 Beta1 处理汉字、拼音、笔画转换
Posted on 2007-11-30 22:10 CDplayer 阅读(341) 评论(0) 编辑 收藏 举报
/*
微软刚刚推出
Microsoft Visual Studio International Pack 1.0 Beta1
支持 汉字 拼音 笔画 转换
http://www.microsoft.com/downloads/details.aspx?FamilyID=e432aeaa-7b6f-4b0d-968b-b6aafda05e34&DisplayLang=en
我已经提取了 dll assembly
ChnCharInfo.dll
ChnCharInfoResource.dll
下载分享
https://files.cnblogs.com/Microshaoft/vsipk1beta.zip
*/
//命令行编译:
//csc.exe noname1.cs /r:ChnCharInfo.dll
namespace Microshaoft
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.International.Converters.PinYinConverter;
public class Class1
{
static void Main(string[] args)
{
//汉字的笔画数
int i = ChineseChar.GetStrokeNumber('饕');
Console.WriteLine(i);
//汉字的所有拼音拼写
ChineseChar x = new ChineseChar('说');
ReadOnlyCollection<string> roc = x.Pinyins;
foreach(string s in roc)
{
Console.WriteLine(s);
}
//拼音拼写的所有汉字
Char[] chars = ChineseChar.GetChars("YUE4");
foreach(Char c in chars)
{
Console.WriteLine(c);
}
//笔画数的所有汉字
chars = ChineseChar.GetChars(20);
foreach(Char c in chars)
{
Console.WriteLine(c);
}
Console.WriteLine(Environment.Version.ToString());
}
}
}
微软刚刚推出
Microsoft Visual Studio International Pack 1.0 Beta1
支持 汉字 拼音 笔画 转换
http://www.microsoft.com/downloads/details.aspx?FamilyID=e432aeaa-7b6f-4b0d-968b-b6aafda05e34&DisplayLang=en
我已经提取了 dll assembly
ChnCharInfo.dll
ChnCharInfoResource.dll
下载分享
https://files.cnblogs.com/Microshaoft/vsipk1beta.zip
*/
//命令行编译:
//csc.exe noname1.cs /r:ChnCharInfo.dll
namespace Microshaoft
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.International.Converters.PinYinConverter;
public class Class1
{
static void Main(string[] args)
{
//汉字的笔画数
int i = ChineseChar.GetStrokeNumber('饕');
Console.WriteLine(i);
//汉字的所有拼音拼写
ChineseChar x = new ChineseChar('说');
ReadOnlyCollection<string> roc = x.Pinyins;
foreach(string s in roc)
{
Console.WriteLine(s);
}
//拼音拼写的所有汉字
Char[] chars = ChineseChar.GetChars("YUE4");
foreach(Char c in chars)
{
Console.WriteLine(c);
}
//笔画数的所有汉字
chars = ChineseChar.GetChars(20);
foreach(Char c in chars)
{
Console.WriteLine(c);
}
Console.WriteLine(Environment.Version.ToString());
}
}
}