Prev | Current Page 280 | Next

Guy Fouch?©, Trey Nash

"Accelerated VB 2008"

None)
cib.LoadDataFromCultureInfo(New CultureInfo("en-US"))
cib.LoadDataFromRegionInfo(New RegionInfo("US"))
'Make the change.
cib.IsMetric = True
'Create the LDML file.
cib.Save("x-en-US-metric.ldml")
'Register with the system.
cib.Register()
End Sub
End Class
nNote In order to build the previous example, you??™ll need to add a reference to the sysglobl.dll
assembly, located in the Windows\Microsoft.NET\Framework\v2.0.xxxxx directory.
You can see that the process is simple, since the CultureAndRegionInfoBuilder has a welldesigned
interface. For illustration purposes, we??™ve sent the LDML to a file so you can see what it
looks like, although it??™s too verbose to list in this text. One thing to consider is that you must have
proper permissions in order to call the Register method. This typically requires that you be the
administrator, although you can get around this by opening up the proper permissions to the
%WINDIR%\Globalization directory and the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\Nls\CustomLocale registry key. Once you register the culture with the system, you can
reference it using the given name when specifying any culture information in the common
language runtime (CLR). For example, to verify that the culture and information region is registered
properly, you can build and execute the following code to test it out:
Imports System
Imports System.


Pages:
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
twarożek ze szczypiorkiem Kalkulator kredytowy Wczasy nad morzem Spa w Ciechocinku buty