Implementation of multi-language in C #

xiaoxiao2021-03-06  18

When designing the system, we often have to encounter a multi-language problem. Here is the results I study after several hours, I hope to use: 1. New resource files: such as: string.zh-cn.resx; string. En-su.resx ... 2. How to get characters in the resource file. Reference interface Using system.resources; define objects (constructor): private resourceManager m_resourceManager = New ResourceManager ("WindowsApplication1.String", System.Reflection.Assembly .GetExecutingAssembly ()); access to resources file character: private ResourceManager textBox1.Text = m_ResourceManager.GetString ( "good", System.Globalization.CultureInfo.CurrentCulture); good that you want to take the value of .3 character, but we might. In the middle, you can change the language of characters, we can first reference the interface with the following statement: use system.threading; thread.currentthread.currentculture = New CultureInfo ("En-US", FALSE);

Just a good job in C #, I hope to have the opportunity to communicate with you!

转载请注明原文地址:https://www.9cbs.com/read-39678.html

New Post(0)