1. asp.net如何獲取文件的首字母拼音
給你個函數:
#region 取漢字首字母
public static string GetFirstLetter(string hz)
{
string ls_second_eng = "" +
"" +
"" +
"" +
"" +
"" +
"WYXQHZ";
string ls_second_ch = "亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鞀丶亟" +
"鼐乜乩亓羋孛嗇嘏仄厙厝厴厥廝靨贗匚叵匭匱匾賾卦卣刂刈刎剄刳劌剴剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞傴仳伢佤仵倀傖伉佇佞佧攸佚佝佟佗伲伽佶佴侑侉侃侏佾佻儕佼儂侔儔儼儷俅俚俁俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨僨偃偕偈偎傯僂儻儐儺傺僖儆僭僬僦僮儇儋仝氽佘僉俎龠氽糴兮巽黌馘囅夔勹匍訇匐鳧夙兕亠兗亳袞袤褻臠裒稟嬴蠃羸冫冱冽冼凇冖冢冥訁訐訌訕謳詎訥詁訶詆詔詘詒誆誄詿詰詼詵詬詮諍諢詡誚誥誑誒諏諑諉諛諗諂誶諶諫謔謁諤諭諼諳諦諮諞謨讜謖謚謐謫譾譖譙譎讞譫讖卩巹阝阢阡阱阪阽阼" +
"陂陘陔陟隉陬陲陴隈隍隗隰邗邛鄺邙鄔邡邴邳邶鄴邸邰郟郅邾鄶郄郇鄆酈郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆芻奐勱劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巰坌堊垡塾墼壅壑圩圬圪圳壙圮圯壢圻坂坩壠坫壚坼坻坨坭坶坳埡垤垌塏埏垧堖垓垠埕塒堝塤埒垸埴垵埸埤埝堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑薌芙芫芸芾芰藶苊苣芘芷芮莧萇蓯芩芴芡芪芟苄薴芤苡茉苷苤蘢茇苜苴苒苘茌苻苓蔦茚茆塋煢苠苕茜荑蕘蓽茈莒茼茴茱莛蕎茯荏荇荃薈荀茗薺茭茺茳犖滎蕁茛藎蕒蓀葒葤莰荸蒔萵莠莪莓莜蒞荼薟莩荽蕕荻" +
"莘莞莨鶯蒓菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀縈菰菡葜葑葚葙葳蕆蒈葺蕢葸萼葆葩葶蔞蒎萱葭蓁蓍蓐驀蒽蓓蓊蒿蒺蘺蒡蒹蒴蒗鎣蕷蔌甍蔸蓰蘞蔟藺蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蘄蕻薤薨薇薏蕹藪薜薅薹薷薰蘚藁藜藿蘧蘅蘩櫱蘼廾弈夼奩耷奕奚奘匏尢尥尬尷扌捫摶抻拊拚拗拮撟拶挹捋捃掭揶捱捺掎摑捭掬掊捩掮摜揲揸揠撳揄揞揎摒揆掾攄摁搋搛搠搌搦搡摞攖摭撖摺擷擼撙攛擀擐擗擤擢攉攥攮弋忒甙弒卟叱嘰叩叨叻吒吖吆呋嘸囈呔嚦呃吡唄咼唚吲咂咔呷呱呤咚嚀咄呶呦噝哐咭哂咴噠咧咦嘵嗶呲咣噦咻咿哌噲哚嚌咩" +
"咪吒噥哏哞嘜哧嘮哽唔哳嗩唣唏唑唧唪嘖喏喵啉囀啁啕唿啐唼唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟嘍嚳喔喙嗪嗷嗉嘟嗑囁嗬嗔嗦嗝嗄嗯嗥嗲噯嗌嗍嗨嗵嗤轡嘞嘈嘌嘁嚶嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙嚕噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡圇囫囹囿圄圊圉圜幃帙帔帑幬幘幗帷幄幔幛襆幡岌屺岍岐嶇岈峴嶴岑嵐岜岵岢崬岬岫岱岣峁岷嶧峒嶠峋崢嶗崍崧崦崮崤崞崆崛嶸崾崴崽嵬嵛嵯嶁嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巔彳彷徂徇徉後徠徙徜徨徭徵徼衢彡犭犰犴獷獁狃狁狎狍狒狨獪狩猻狴狷猁狳獫狺狻猗猓玀猊猞猝獼猢猹猥蝟猸猱獐獍獗獠獬獯獾" +
"舛夥飧夤夂飠餳飩餼飪飫飭飴餉餑餘餛餷餿饃饈饉饊饌饢庀廡庋庖庥庠庹庵庾庳賡廒廑廛廨廩膺忄忉忖懺憮忮慪忡忤愾悵愴忪忭忸怙怵怦怛怏怍怩怫怊懌怡慟懨惻愷恂恪惲悖悚慳悝悃悒悌悛愜悻悱惝惘惆惚悴慍憒愕愣惴愀愎愫慊慵憬憔憧憷懍懵忝隳閂閆闈閎閔閌闥閭閫鬮閬閾閶鬩閿閽閼闃闋闔闐闕闞丬爿戕氵汔汜汊灃沅沐沔沌汨汩汴汶沆溈泐泔沭瀧瀘泱泗沲泠泖濼泫泮沱泓泯涇洹洧洌浹湞洇洄洙洎洫澮洮洵洚瀏滸潯洳涑浯淶潿浞涓涔浜浠浼浣渚淇淅淞瀆涿淠澠淦淝淙瀋涫淥涮渫湮湎湫溲湟漵湓湔渲渥湄灧溱溘灄漭瀅溥溧溽溻溷潷溴滏溏滂" +
"溟潢瀠瀟灠漕滹漯漶瀲瀦漪漉漩澉澍澌潸潲潼潺瀨濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灝灞宀宄宕宓宥宸甯騫搴寤寮褰寰蹇謇辶迓迕迥迮迤邇迦逕迨逅逄逋邐逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屨羼弳弩弭艴弼鬻屮妁妃妍嫵嫗妣妗姊媯妞妤姒妲妯姍妾婭嬈姝孌姣姘奼娌娉媧嫻娑娣娓婀婧婊婕娼婢嬋胬媼媛婷婺媾嫫媲嬡嬪媸嫠嫣嬙嫖嫦嫘嫜嬉嬗嬖嬲嬤孀尕尜孚孥孳孑孓孢駔駟駙騶驛駑駘驍驊駢驪騏騍騅驂騭騖驁騮騸驃驄驏驥驤糹紆紂紇紈纊紜紕紓紺紲紱縐紼絀紿絝絎絳綆綃綈綾綺緋緔緄綞綬綹綣綰緇緙緗" +
"緹緲繢緦緶緱縋緡縉縝縟縞縭縊縑繽縹縵縲繆繅纈繚繒韁繾繰繯纘幺畿巛甾邕玎璣瑋玢玟珏珂瓏玷玳珀珉珈珥珙頊琊珩珧珞璽琿璉琪瑛琦琥琨琰琮琬琛琚瑁瑜瑗瑕瑙璦瑭瑾璜瓔璀璁璇璋璞璨璩璐璧瓚璺韙韞韜杌杓杞杈榪櫪枇杪杳枘梘杵棖樅梟枋杷杼柰櫛柘櫳柩枰櫨柙枵柚枳柝梔柃枸柢櫟柁檉栲栳椏橈桎楨桄榿梃栝桕樺桁檜桀欒桊桉栩梵梏桴桷梓桫欞楮棼櫝槧棹欏棰椋槨楗棣椐楱椹楠楂楝欖楫榀榘楸椴槌櫬櫚槎櫸楦楣楹榛榧榻榫榭槔榱槁槊檳榕櫧榍槿檣槭樗樘櫫槲橄樾檠橐橛樵檎櫓樽樨橘櫞檑檐檁檗檫猷獒歿殂殤殄殞殮殍殫殛殯殪軔軛軲軻轤軹軼" +
"軫軤轢軺軾輊輇輅輒輦輞輟輜輳轆轔軎戔戧戛戟戢戡戥戤戩臧甌瓴瓿甏甑甓攴旮旯旰昊曇杲昃昕昀炅曷昝昴昱昶昵耆晟曄晁晏暉晡晗晷暄暌曖暝暾曛曜曦曩賁貰貺貽贄貲賅贐賑賚賕齎賧賻覘覬覡覿覦覯覲覷牮犟牝氂牯牾牿犄犋犍犏犒挈挲掰搿擘耄毪毳毽毿毹氅氌氆氍氕氘氙氚氡氬氤氪氳攵敕敫牘牒牖爰虢刖肟肜肓肼朊肽肱肫肭餚肷朧腖胩臚胛胂胄胙胍胗朐胝脛胱胴胭膾脎胲胼朕脒豚腡脞脬脘脲腈腌腓腴腙腚腱腠腩靦膃齶腧塍媵膈膂臏滕膣膪臌朦臊膻臁膦歟欷欹歃歆歙颮颯颶颼飆飈殳彀轂觳斐齏斕於旆旄旃旌旎旒旖煬煒燉熗炻烀炷炫炱燁烊焐焓燜焯焱" +
"煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬燾煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚禰祗祠禎祧祺禪禊禚禧禳忑忐懟恝恚恧恁恙恣愨愆愍慝憩憝懋懣戇肀聿沓澩淼磯矸碭砉硨砘砑斫砭碸砝砹礪礱砟砼砥砬砣砩硎硭硤磽砦硐硇硌硪磧碓碚碇磣碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龕黹黻黼盱眄瞘盹眇眈眚眢眙眭眥眵眸睞瞼睇睃睚睨睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨羆罱罹羈罾盍盥蠲釒釓釔釙釗釕釷釧釤鍆釵釹鈈鈦鉅鈑鈐鈁鈧鈄鈥鈀鈺鉦鈷鈳鉕鈽鈸鉞鉬鉭鈿鑠鈰鉉鉈鉍鈮鈹鐸銬銠鉺銪鋮鋏鐃鋣鐺銱銦鎧銖鋌銩鏵銓鉿鎩銚錚銫銃鐋銨銣鐒錸" +
"鋱鏗鋥鋰鋯鋨銼鋝鋶鐦鐧鋃鋟鋦錒錆鍩錛鍀錁錕錮鍃錇錈錟錙鍥鍇鍶鍔鍤鎪鍰鎄鏤鏘鐨鎇鏌鎘鐫鎿鎦鎰鎵鑌鏢鏜鏝鏍鏞鏃鏇鏑鐔钁鏷鑥鐓鑭鐠鑹鏹鐙鑊鐲鐿鑔鑣鍾矧矬雉秕秭秣秫穭嵇稃稂稞稔稹稷穡黏馥穰皈皎皓皙皤瓞瓠甬鳩鳶鴇鴆鴣鶇鸕鴝鴟鷥鴯鷙鴰鵂鸞鵓鸝鵠鵒鷳鵜鵡鶓鵪鵯鶉鶘鶚鶿鶥鶩鷂鶼鸚鷓鷚鷯鷦鷲鷸鸌鷺鸛疒疔癤癘疝癧疣疳痾疸痄皰疰痃痂瘂痍痣癆痦痤癇痧瘃痱痼痿瘐瘀癉瘌瘞瘊瘥瘺瘕瘙瘛瘼瘢瘠癀瘭瘰癭瘵癃癮瘳癍癩癔癜癖癲癯翊竦穸穹窀窆窈窕竇窠窬窨窶窳衤衩衲衽衿袂襠袷袼裉褳裎襝襇裱褚裼裨裾裰褡褙褓褸褊襤褫褶襁襦疋胥皸皴矜耒" +
"耔耖耜耠耮耥耦耬耩耨耱耋耵聃聆聹聒聵聱覃頇頎頏頡頜潁頦頷顎顓顳顢顙顥顬顰虍虔虯蟣蠆虺虼虻蚨蚍蚋蜆蚝蚧蚣蚪蚓蚩蚶蛄蚵蠣蚰蚺蚱蚯蛉蟶蚴蛩蛺蟯蛭螄蛐蜓蛞蠐蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蟈蜴蜱蜩蜷蜿螂蜢蝽蠑蝻蝠蝰蝌蝮螋蝓蝣螻蝤蝙蝥螓螯蟎蟒蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罌罄罅舐竺竽笈篤笄筧笊笫笏筇笸笪笙笮笱笠笥笤笳籩笞筘篳筅筵筌箏筠筮筻筢筲筱箐簀篋箸箬箝籜箅簞箜箢簫箴簣篁篌篝篚篥篦篪簌篾篼簏籪簋簟簪簦簸籟籀臾舁舂舄臬衄舡舢艤舭舯舨舫舸艫舳舴舾艄艉艋艏艚艟艨衾裊袈裘裟襞羝羥" +
"羧羯羰羲秈敉粑糲糶粞粢粲粼粽糝餱糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸縶綦綮繇纛麩麴赳趄趔趑趲赧赭豇豉酊酐酎酏酤酢酡醯酩酯釅釃酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹺躉跫踅蹙蹩趵趿趼趺蹌跖跗跚躒跎跏跛跆跬蹺蹕跣躚躋跤踉跽踔踝踟躓踮踣躑踺蹀踹踵踽踱蹉蹁蹂躡蹣蹊躕蹶蹼蹯蹴躅躪躔躐躦躞豸貂貊貅貘貔斛觖觴觚觜觥觫觶訾謦靚雩靂雯霆霽霈霏霎霪靄霰霾齔齟齙齠齜齦齬齪齷黽黿鼉隹隼雋雎雒瞿讎銎鑾鋈鏨鍪鏊鎏鐾鑫魷魴鮁鮃鯰鱸穌鮒鱟鮐鮭鮚鮪鮞鱭鮫鯗鱘鯁鱺鰱鰹鰣鰷鯀鯊鯇鯽鯖鯪鯫鯡鯤鯧鯝鯢鯰鯛鯴鯔鱝鰈鱷鰍鰒鰉鯿鰠鰲鰭鰨鰥鰩鰳鰾" +
"鱈鰻鰵鱅鱖鱔鱒鱧靼鞅韃鞽鞔韉鞫鞣韝鞴骱骰骷鶻骶骺骼髁髀髏髂髖髕髑魅魃魘魎魈魍魑饗饜餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬢鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黷黧黥黲黯鼢鼬鼯鼴鼷鼽鼾齇";
byte[] array = new byte[2];
string return_py = "";
for (int i = 0; i < hz.Length; i++)
{
array = System.Text.Encoding.Default.GetBytes(hz[i].ToString());
if (array[0] < 176) //.非漢字
{
return_py += hz[i];
}
else if (array[0] >= 176 && array[0] <= 215) //一級漢字
{
if (hz[i].ToString().CompareTo("匝") >= 0)
return_py += "z";
else if (hz[i].ToString().CompareTo("壓") >= 0)
return_py += "y";
else if (hz[i].ToString().CompareTo("昔") >= 0)
return_py += "x";
else if (hz[i].ToString().CompareTo("挖") >= 0)
return_py += "w";
else if (hz[i].ToString().CompareTo("塌") >= 0)
return_py += "t";
else if (hz[i].ToString().CompareTo("撒") >= 0)
return_py += "s";
else if (hz[i].ToString().CompareTo("然") >= 0)
return_py += "r";
else if (hz[i].ToString().CompareTo("期") >= 0)
return_py += "q";
else if (hz[i].ToString().CompareTo("啪") >= 0)
return_py += "p";
else if (hz[i].ToString().CompareTo("哦") >= 0)
return_py += "o";
else if (hz[i].ToString().CompareTo("拿") >= 0)
return_py += "n";
else if (hz[i].ToString().CompareTo("媽") >= 0)
return_py += "m";
else if (hz[i].ToString().CompareTo("垃") >= 0)
return_py += "l";
else if (hz[i].ToString().CompareTo("喀") >= 0)
return_py += "k";
else if (hz[i].ToString().CompareTo("擊") >= 0)
return_py += "j";
else if (hz[i].ToString().CompareTo("哈") >= 0)
return_py += "h";
else if (hz[i].ToString().CompareTo("噶") >= 0)
return_py += "g";
else if (hz[i].ToString().CompareTo("發") >= 0)
return_py += "f";
else if (hz[i].ToString().CompareTo("蛾") >= 0)
return_py += "e";
else if (hz[i].ToString().CompareTo("搭") >= 0)
return_py += "d";
else if (hz[i].ToString().CompareTo("擦") >= 0)
return_py += "c";
else if (hz[i].ToString().CompareTo("芭") >= 0)
return_py += "b";
else if (hz[i].ToString().CompareTo("啊") >= 0)
return_py += "a";
}
else if (array[0] >= 215) //二級漢字
{
return_py += ls_second_eng.Substring(ls_second_ch.IndexOf(hz[i].ToString(), 0), 1);
}
}
return return_py.ToUpper();
}