|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Errors when translating CultureInfo from C# to VBIn C# it works OK, but in this project with VB I get some problems. //*********** The code is: **************************** .... 1. using System.Resources; 2. using System.Globalization; 3. using System.Threading; 4. namespace namespaceName 5. public class Test : Sustem.Web.UI.Page ... 6. protected ResourceManager rmName; 7. private void Page_Load(.... 8. { 9. string strCultureInfo = "Fr"; //french 10. Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(strCultureInfo); 11. Thread.CurrentThread.CurrentUICulture = new CultureInfo(strultureInfo); 12. rmName = new ResourceManager("namespaceName.ProjectName", typeof(webform).Assembly); 13. lblAddress.Text = rmName.GetString("Address"); 14. } //************** Stop *************************** In VB I get problems on line 6 and line 12 There must be another syntax i VB reidarT It is not the job of this newgroup to convert code from C# to VB.NET. There
are many convertors out there on the Internet. Line 5 Spelling mistake - should be SYSTEM not SUSTEM Line 11 Spelling mistake - should be StrCultureInfo not strultureInfo and so on. Crouchie1998 BA (HONS) MCP MCSE "ReidarT" <rei***@eivon.no> schrieb: Converting code between .NET programming languages>I use cultureinfo to select right language on labels on webform. > In C# it works OK, > but in this project with VB I get some problems. <URL:http://dotnet.mvps.org/dotnet/faqs/?id=languageconverters&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Reidar,
Are you sure this is working in a ASPNet environment and not taking the language from the server. In my opinion can you use the httprequest.servervariables to get the language from the client http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpRequestClassServerVariablesTopic.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/21b3be8f-d4ed-4059-8e21-6cba2c253006.asp HTTP_ACCEPT_LANGUAGE While the culture is missing. Therefore you make me curious. Cor
Determine if "Hide extensions for known file types" is active
Need help updating table What scope is best for defining Enum type? VB6 to VB.Net Conversion Go to URL on Button_Click How to overload method of third party component? Selecting specific columns from a dataview? StringBuilder size question? mysql date format Limiting the directories somebody can browse to..... |
|||||||||||||||||||||||