資源簡介
將日語中的假名轉換為羅馬音,給日語新手們用
主要使用string的replace方法進行替換,促音特殊處理
使用時請加載字典,在DEBUG目錄下

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.IO;
using?Microsoft.VisualBasic;
using?System.Runtime.InteropServices;
using?Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
namespace?_1help
{
????public?partial?class?Form1?:?Form
????{
????????//[DllImport(“kernel32.dll“?EntryPoint?=?“LCMapStringA“)]
????????[DllImport(“microsoft.visualbasic.dll“?CharSet?=?CharSet.Auto)]
????//public?static?extern?int?LCMapString(int?Locale?int?dwMapFlags?byte[]?lpSrcStrint?cchSrc?byte[]?lpDestStrint?cchDest);
????????public?static?extern?string?StrConv(string?str?VbStrConv?Conversion?[OptionalAttribute]?int?LocaleID);
????const?int?LCMAP_SIMPLIFIED_CHINESE?=?0x02000000;
????const?int?LCMAP_TRADITIONAL_CHINESE?=?0x04000000;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?btnOpen_Click(object?sender?EventArgs?e)
????????{
????????????OpenFileDialog?ofd?=?new?OpenFileDialog();
????????????ofd.title?=?“打開字典“;
????????????ofd.Multiselect=true;
????????????ofd.InitialDirectory?=?Application.StartupPath;
????????????ofd.Filter?=?“字典文件(*.dic)|*.dic|文本文件(*.txt)|*.txt“;
????????????if(ofd.ShowDialog()==DialogResult.OK)
????????????{
????????????????try
????????????????{
????????????????????string[]?fname?=?ofd.FileNames;
????????????????????for?(int?i?=?0;?i?????????????????????{
????????????????????????lbFilelist.Items.Add(fname[i].Substring(fname[i].LastIndexOf(‘\\‘)?+?1));
????????????????????????StreamReader?sr?=?new?StreamReader(fname[i]Encoding.Defaulttrue);
????????????????????????string?read?=?null;
????????????????????????while?((read?=?sr.ReadLine())?!=?null)
????????????????????????{
????????????????????????????lbCvtList.Items.Add(read);
????????????????????????}
????????????????????????sr.Close();
????????????????????}
????????????????}
????????????????catch?(Exception?es)
????????????????{
????????????????????MessageBox.Show(“Error:“?+?es.Message);
????????????????}
????????????????????????
????????????}
????????}
????????private?void?btnInput_Click(object?sender?EventArgs?e)
????????{
????????????OpenFileDialog?ofd?=?new?OpenFileDialog();
????????????ofd.title?=?“打開字典“;
????????????ofd.Multiselect?=?true;
????????????ofd.InitialDirectory?=?Application.StartupPath;
????????????ofd.Filter?=?“歌詞文件(*.lrc)|*.lrc|文本文件(*.txt)|*.txt“;
????????????if(ofd.ShowDialog()==DialogResult.OK)
????????????{
????????????????try
????????????????{
????????????????????string?[]fname=ofd.FileNames;
????????????????????tbInputFile.Text=null;
????????????????????foreach(string?fn?in?fname)
????????????????????{
????????????????????????tbInputFile.Text?+=?fn+“|“;
????????????????????}
????????????????}
????????????????catch?(Exception?es)
?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3661??2009-08-01?14:05??11help\11help\11help.csproj
?????文件???????5632??2005-12-08?14:51??11help\11help\bin\Debug\11help.vshost.exe
?????文件????????826??2009-08-01?00:57??11help\11help\bin\Debug\平假名.txt
?????文件??????24576??2009-08-01?14:28??11help\11help\bin\Debug\11help.exe
?????文件??????26112??2009-08-01?14:28??11help\11help\bin\Debug\11help.pdb
?????文件????????409??2009-08-01?01:09??11help\11help\bin\Debug\人稱代詞.txt
?????文件????????179??2009-08-01?14:13??11help\11help\bin\Debug\常用詞.txt
?????文件??????29776??2008-03-24?17:12??11help\11help\bin\Debug\ChineseConverter.dll
?????文件???????3446??2008-01-14?15:42??11help\11help\bin\Debug\ChineseConverter.xm
?????文件???????1178??2009-08-01?14:09??11help\11help\bin\Debug\測試用.txt
?????文件???????5632??2005-12-08?14:51??11help\11help\bin\Release\11help.vshost.exe
?????文件??????24576??2009-07-31?21:35??11help\11help\bin\Release\11help.exe
?????文件??????22016??2009-07-31?21:35??11help\11help\bin\Release\11help.pdb
?????文件???????6359??2009-07-17?12:56??11help\11help\Form1.Designer.cs
?????文件???????5814??2009-07-17?12:56??11help\11help\Form1.resx
?????文件????????602??2009-08-01?14:28??11help\11help\obj\11help.csproj.FileList.txt
?????文件????????180??2009-07-31?22:07??11help\11help\obj\Debug\_1help.Form1.resources
?????文件????????180??2009-07-31?22:07??11help\11help\obj\Debug\_1help.Properties.Resources.resources
?????文件????????842??2009-07-31?22:07??11help\11help\obj\Debug\11help.csproj.GenerateResource.Cache
?????文件??????24576??2009-08-01?14:28??11help\11help\obj\Debug\11help.exe
?????文件???????2916??2009-08-01?14:05??11help\11help\obj\Debug\ResolveAssemblyReference.cache
?????文件??????26112??2009-08-01?14:28??11help\11help\obj\Debug\11help.pdb
?????文件????????180??2009-07-31?21:35??11help\11help\obj\Release\_1help.Form1.resources
?????文件????????180??2009-07-31?21:35??11help\11help\obj\Release\_1help.Properties.Resources.resources
?????文件????????842??2009-07-31?21:35??11help\11help\obj\Release\11help.csproj.GenerateResource.Cache
?????文件??????22016??2009-07-31?21:35??11help\11help\obj\Release\11help.pdb
?????文件??????24576??2009-07-31?21:35??11help\11help\obj\Release\11help.exe
?????文件????????465??2009-07-17?00:21??11help\11help\Program.cs
?????文件???????1190??2009-07-17?00:21??11help\11help\Properties\AssemblyInfo.cs
?????文件???????2866??2009-07-17?00:21??11help\11help\Properties\Resources.Designer.cs
............此處省略22個文件信息
- 上一篇:交通旅行模擬
- 下一篇:物流配貨網項目源代碼
評論
共有 條評論