VB.NET默认语言 [英] VB.NET DEFAULT LANGUAGE

查看:123
本文介绍了VB.NET默认语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告诉我安装两种语言后如何使用vb.net项目和asp.net网站语言.
一种是英语,第二种是乌尔都语,因此在页面加载时我想使用乌尔都语作为默认语言.

Please tell me how I can use my vb.net project and asp.net web site language when I have installed two languages.
One is English and second is Urdu so I want to use Urdu as default language when page load.

推荐答案

如果您的意思是如何使您的网页在乌尔都语中显示然后...

.NET运行时在确定要使用的资源文件时会检查System.Threading.Thread.CurrentThread.CurrentUICulture属性.

可以在此处
找到设置aspx页面文化的示例.
设置页面的语言后,要本地化的所有字符串都应存储在.resx文件中.您的resx文件需要根据其使用的语言来命名,例如:

Default.aspx.resx [您的Default.aspx默认资源文件]
Default.aspx. es .resx [西班牙语版本]

重要的是文件名必须相同,除了语言代码外,而且语言代码必须位于.resx
之前.

在您的aspx页上(以及后面的代码中),上面列出的资源文件的内容可以作为
If you mean how can you make your web pages display in Urdu then...

The .NET runtime checks the System.Threading.Thread.CurrentThread.CurrentUICulture property when deciding what resource file to use.

An example of setting an aspx page''s culture can be found here

After you''ve set the page''s language, any strings that you want to be localized should be stored in .resx files. Your resx files need to be named according to the language that they use, so for example:

Default.aspx.resx [your default resource file for Default.aspx]
Default.aspx.es.resx [Spanish version]

It''s important that the file names are the same except for the language code and also the language code must be just before the .resx


on your aspx page (and in your code-behind), the contents of the resource files listed above could be accessed as
Resources.Default.aspx.<string name from the resx file>


访问
因此,您的aspx可能有类似...



So, your aspx might have something like...

<H2><%=Resources.Default.aspx.pagetitle %></H2>



并且如果页面的区域性设置为西班牙语,则它将使用Default.aspx.es.resx中的字符串而不是Default.aspx.resx

希望对您有所帮助:)



and if the page''s culture is set to Spanish, then it would use the string from Default.aspx.es.resx instead of Default.aspx.resx

I hope this helps :)


ASP.Net本地化 [^ ]


这篇关于VB.NET默认语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆