您现在的位置:首页 > 教案格式 > 正文

百岁山矿泉水广告结局_鐧惧害鍦板浘什么意思_鐧惧害闊j充箰(27)

2016-12-23 16:00 网络整理 教案网

};

#endregion

public static string Convert(string str)

{

if (str == null )

return null;

Encoding ed = Encoding.GetEncoding("GB2312");

if (ed == null)

throw (new ArgumentException("没有找到编码集GB2312"));

int bh = 0;

char[] charary = str.ToCharArray();

byte[] bAry = new byte[2];

StringBuilder rtnSb = new StringBuilder();

for (int i = 0;i< charary.Length ;i++)

{

bAry = ed.GetBytes(charary[i].ToString());

if (bAry.Length == 1)

{

rtnSb.Append(charary[i]);

continue;

}

bh = bAry[0] - 0xA0;

if ( 0x10 <= bh && bh <= 0x57)//是gb2312汉字

{

bool isFind = false;

for (int j = 0; j< _Allhz.Length;j++)

{

if (_Allhz[j][1].IndexOf(charary[i])!=-1)

{

rtnSb.Append(_Allhz[j][0]);

isFind = true;

break;

}

}

if (!isFind)

rtnSb.Append(charary[i]);

}

else

rtnSb.Append(charary[i]);

}

return rtnSb.ToString();

}

}

StrToPinyin.cs

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

/// <summary>

/// Summary description for StrToPinyin

/// </summary>

public class StrToPinyin

{

public StrToPinyin()

{}

private static string[] strChineseCharList =

{

#region

"A阿啊锕嗄厑哎哀唉埃挨溾锿鎄啀捱皑凒溰嘊敳皚癌毐昹嗳矮蔼躷噯藹譪霭靄艾伌爱砹硋隘嗌塧嫒愛碍暧瑷僾壒嬡懓薆曖璦鴱皧瞹馤鑀鱫安侒峖桉氨庵谙萻腤鹌蓭誝鞌鞍盦馣鮟盫韽啽雸垵" ,

"A俺唵埯铵隌揞罯銨犴岸按荌案胺豻堓婩暗貋儑錌黯肮岇昂昻枊盎醠凹坳垇柪軪爊敖厫隞嗷嗸嶅廒滶獒獓遨熬璈蔜翱聱螯翶謷翺鳌鏖鰲鷔鼇芺袄媪镺襖岙扷岰傲奡奥嫯慠骜奧嶴澳懊擙謸鏊" ,

"B八仈巴叭扒朳玐吧夿岜芭疤哵捌笆粑紦羓蚆釟豝鲃魞叐犮抜坺妭拔茇炦癹胈釛菝詙跋軷魃把靶坝弝爸垻罢鲅鮁覇矲霸壩灞欛挀掰白百佰柏栢捭竡粨摆擺襬呗拝败拜唄敗稗粺鞁薭贁兡瓸扳" ,