authentica-Note that the NetworkCredentialclass is not available on the .NET Compact Framework 1.0 and 1.1.You need to install the .NET Compact Framework 2.0 to leverage this service for
Trang 1}}private void mnuQuit_Click(object sender, EventArgs e){
Application.Exit();
}}}Because accessing a database is normally error prone, it is always a good practice to put the database-related operations in the tryblock and handle possible exceptions in the catchblock
Figures 13-5 and 13-6 show the running results of the application
The preceding example demonstrates how to protect a database with a password and encryption Notethat the application is expected to run only once because you don’t want to create the same database ortable repeatedly
Figure 13-5
Trang 2Figure 13-6
Securing Communication Channels
The thin-client nature of Smartphone devices means that they are constantly talking to various servers
to access information When passing sensitive data over a network, especially a wireless network, it isextremely important to secure the communication at both ends
is then compared to the response from the client If they match, the authentication is successful An tage of NTLM is that the user’s password is not sent over the network during the authentication process
advan-346
Trang 3Kerberos involves a much more complicated process, but it offers a more secured communication nel Because of its better security, it will be picked during the authentication negotiation process whenboth NTLM and Kerberos are supported NTLM is mainly used in Microsoft’s early products, such asWindows NT 4.0
chan-The System.Net.NetworkCredentialclass can create credentials to authenticate the user with themost secure method supported by the server The code to generate the network credential is as follows:using System.Net;
NetworkCredential myCredentials =
new NetworkCredential(“myUserName”, “MyPasswd”, “myDomainName”);
You can then use the generated credentials to secure network applications that require user tion, such as web services
authentica-Note that the NetworkCredentialclass is not available on the NET Compact Framework 1.0 and 1.1.You need to install the NET Compact Framework 2.0 to leverage this service for network authentication
Secure Sockets Layer (SSL)
Secure Sockets Layer (SSL) is the industry standard for secure web communications It is used widely
in today’s e-communication to transmit sensitive information, such as credit card numbers and onlinebanking, over the Internet
Essentially, SSL is the technology that involves encrypting and decrypting messages between a webbrowser and the web server SSL does not prevent hackers from eavesdropping, but the encryptedmessage makes it much harder for hackers to access the message
Typically, message communication in SSL proceeds as follows:
1. The client initiates SSL communication, such as an HTTPS request
2. The client starts an SSL session with a unique public key that is created for the client’s webbrowser
3. The message is encrypted with the server’s public key and sent to the web server
4. The web server decrypts the information with its private key, which is kept secret; no one elsehas the knowledge of this private key
This process is considered fairly secure because each SSL session generates a unique public key that ahacker is unlikely to guess The message is encrypted with the server’s public key, which (in theory),only the web server itself is able to decrypt
The length of the key in SSL communication is either 40-bit or 128-bit The longer the key length, the harder it is to crack the message.
To enable SSL communication, you need to install certificates on the server side Certificates can beobtained from different certificate authorities, such as VeriSign and GeoTrust The certificate application
Trang 4process is normally pretty straightforward and requires a certificate signing request (CSR) file On an IISServer, the steps to generate the CSR file are as follows:
1. Select Start➪Run, and type compmgmt.msc to launch the Computer Management console.
2. On the left panel, expand the Services and Applications and then expand Internet InformationServices
3. Expand Web Sites, right-click Default Web Site, and then choose Properties (see Figure 13-7)
4. Select the Directory Security tab in the Default Web Site Properties window and click the ServerCertificate button (see Figure 13-8)
5. Choose “Create a new certificate” from the IIS Certificate Wizard (see Figure 13-9) and input therequired information, such as country, website name, and the name of the certificate file
Figure 13-7
348
Trang 5Figure 13-8
Figure 13-9
When going through the wizard, you need to provide organizational information, geography tion, and so on Remember that the common name has to be the DNS name or NetBIOS name (normallythe computer name) of the web server, as illustrated in Figure 13-10
Trang 6informa-Figure 13-10
You can use the CSR file created by the wizard to request the certificate from your CA Once the request
is granted, follow the certificate authority’s instructions to install the certificate on the web server Most of the work to set up and enable SSL communication is on the server side If the web server is cor-rectly installed and protected with SSL, you simply specify an HTTPS request on the client side
For example, the following code will start an SSL-enabled HTTPS request with a SSL-enabled web servernamed mySecureServer.Com:
using System.Net;
WebRequest webReq = WebRequest.Create(“https://mySecureServer.com”);
Likewise, if you want to protect SQL Server Mobile database replication, use httpsin the InternetURLproperty:
Virtual Private Networks
A virtual private network (VPN) is a common network mechanism to provide secure end-to-end networkconnections The idea is to first negotiate and set up a network tunnel between the two communicationnodes Usually, a VPN server also connects to a RADIUS server, allowing only authorized users to havethe permissions to establish such tunnels The data is then encrypted before it is transmitted over the net-work Then it will be decrypted on the receiver side Compared to a dedicated private leased line, a VPN
is preferred by many companies because of its low cost
350
Trang 7Consider a corporate network without the support VPN As shown in Figure 13-11, a remote user needs
to dial up the corporate Remote Access Server (RAS) to get access the servers This could be very pricey
if users are trying to make a data connection through long-distance calls Similar problems also exist onthe remote offices and mobile users
Figure 13-11
With a VPN, however, users do not need to directly dial to the corporate headquarters A remote usercan simply dial into the local access server and rely on the local ISPs to package the data and route thedata through a “tunnel” to the remote servers Of course, you need to pay for the tunnel services offered
by the ISPs, but it is typically less than half of what you pay for leased lines or long-distance phone calls.Three major tunneling protocols are supported via the Internet:
❑ IP Security (IPSec)— Developed by the Internet Engineering Task Force (IETF), this protocoloperates at the network layer and can be implemented independent of application layer
❑ Point-to-point Tunneling Protocol (PPTP)— This is the protocol developed by Microsoft,3Come, and Ascent Communications It works at the data link layer and is preferred forMicrosoft Windows–based network traffic
❑ Layer 2 Tunneling Protocol (L2TP)— This is the implementation of Cisco, which combinestheir previously proposed Layer 2 Forwarding with PPTP It offers more flexibility than PPTP,but need supports from the underlying network devices, such as routers and switches
VPN Gateway
VPN Tunnel
VPN Tunnel
VPN Tunnel VPN
Server
Trang 8The advantages of a VPN include reduced cost, effective use of bandwidth, enhanced scalability, andenhanced connectivity With added-on services, it also offers better security than conventional Internetprotocols The drawback of a VPN is also obvious: It is highly dependent on the Internet and lacks inter-operability of devices and protocols.
The NET Compact Framework 2.0 supports PPTP, L2TP, and IPSec (as opposed to the NET CompactFramework 1, which supports only PPTP)
To set up a VPN connection on a Smartphone device, perform the following steps:
1. Choose Start➪Settings➪Connections➪VPN.
2. Click the Menu button and choose Add from the popup menu.
3. In the Add VPN screen, shown in Figure 13-12, enter a description for your VPN
Figure 13-12
Besides setting up the VPN connection correctly at the Smartphone end, you should also make sure thatthe VPN server is running properly at the other end and that the VPN technology is supported by theunderlying networks Data communication using a VPN is highly recommended for Smartphone appli-cations to enhance communication security
352
Trang 9The IEEE 802.11 wireless network, also known as Wi-Fi, is operating at the unlicensed 2.4 GHz band Thenature of radio waves enables it to travel through walls, and therefore makes the indoor and outdoorwireless communication fairly convenient However, it also imposes a severe network security threatbecause messages are broadcasted over the air between client and base station Anyone with a properdevice can intercept and tamper with the message
In 1999, Wired Equivalent Privacy (WEP) was proposed and implemented on Wi-Fi networks It uses ashared secret key and RC4 algorithm with a key length of 40 bits Researchers later identified the securityflaws of WEP and it is no longer considered secure The extension of WEP — namely, WEP2 — addressessome of the early concerns and increases the key size to 128 bits However, for network experts, WEP2 isalso flawed and can only be categorized as a weak security protocol
If you have a choice, don’t use WEP Instead, you should use protocols defined in IEEE802.11i, such
as Wi-Fi Protected Access (WPA), Extensible Authentication Protocol (EAP), or Protected ExtensibleAuthentication Protocol (PEAP)
Securing Web Ser vices with SOAP HeadersWhen deploying web services, one way to implement security is to enforce user authentication from theweb server The Microsoft Internet Information Services (IIS) server provides the following four optionsfor user authentication:
❑ Anonymous access— No authentication is required to access the web resources
❑ Basic authentication— A user is authenticated by sending his or her username and password
to the web server over the network in clear text This is not a recommended authenticationmethod It exists simply as a fallback authentication protocol if a more secured authenticationprotocol is not supported
❑ Digest authentication for Windows domain servers— This option is enabled if the IIS server is
a member server of a Windows domain A user’s password is not sent over the network in this
authentication process; rather, the MD5 hash value of the password, termed a digest, is
transmit-ted through the network and compared with the digest stored in the domain controller
❑ Integrated Windows authentication— This uses the NTLM authentication protocol andrequires a Windows user account on the machine on which the IIS server is installed
To change the authentication method for an IIS server, launch the IIS service management console byclicking Start➪Settings➪Control Panel➪Administrative Settings➪Internet Information Services On theleft panel, expand the name of the IIS server, followed by Web Sites Right-click Default Web Site andchoose Properties In the Directory Security tab, click the Edit button in Anonymous access and userauthentication control An Authentication Methods window will appear, as shown in Figure 3-13
Trang 10Using a custom SOAP header alone is not a secured solution because usernames and passwords are
transmitted over the Internet as clear text You should apply this approach only in a secured cation channel, such as SSL or a VPN.
communi-In the following two subsections, you are going to learn how to build and publish an ASP.NET web vice on the server side and how to connect to the web service from the client side
ser-Server Side
Following are the major steps to perform to create a web service with an authentication SOAP header onthe server side:
1. Create a new website from Visual Studio 2005 with ASP.NET web services.
2. Write a simple web service function that can authenticate a user using the SOAP header.
3. Build and publish the website
4. Test the web service
To create a new website from Visual Studio 2005, click File➪New➪Web Site, as shown in Figure 13-14
354
Trang 11Figure 13-14
The New Web Site dialog will appear, as shown in Figure 13-15 Select the ASP.NET Web Service template
Figure 13-15
Trang 12To write an ASP.NET web services application that requires a SOAP header, you need to create a SOAPheader class that inherits and customizes the System.Web.Services.Protocols.SoapHeaderclass.The following code snippet defines a SoapAuthenHeaderclass that inherits the SoapHeaderclass andhas two public properties: usernameand password:
using System.Web.Services.Protocols;
public class SoapAuthenHeader : SoapHeader
{
public string username;
public string password;
}
Then in the web method, you must declare that a SoapHeaderobject is required using directives Forexample, the following directive requires a SoapAuthenHeaderobject userAuthen Setting theSoapHeaderDirectionenumeration to Inmeans the header is sent from the client to the server:public SoapAuthenHeader UserAuthen;
[WebMethod (Description=”A simple web service authentication via Soap Header”)][SoapHeader(“UserAuthen”,Direction=SoapHeaderDirection.In)]
A simple user authentication method can then be written In the following snippet, the SimpleAuthen()method will return a string indicating that authentication is successful if the usernameproperty is Testand the passwordproperty is Yes:
public string SimpleAuthen() {
if (UserAuthen == null)return “Sorry, you need to provide username and password to access this webservice”;
if (UserAuthen.username == “Test” && UserAuthen.password == “Yes”){
return “Congratulations, you are authenticated via Soap Header extension!”;}
elsereturn “Sorry, your username and password are incorrect Please try again”;}
The code for the server-side web service is as follows:
public string username;
public string password;
}
356
Trang 13}[WebMethod (Description=”A simple web service authentication via Soap Header”)][SoapHeader(“UserAuthen”,Direction=SoapHeaderDirection.In)]
public string SimpleAuthen() {
if (UserAuthen == null)return “Sorry, you need to provide username and password to access thisweb service”;
if (UserAuthen.username == “Test” && UserAuthen.password == “Yes”){
return “Congratulations, you are authenticated via Soap Headerextension!”;
}elsereturn “Sorry, your username and password are incorrect Please tryagain”;
}}You can then build the website by choosing Build➪Build Web Site After the website is built, it isready to be published Choose Build➪Publish Web Site, as shown in Figure 13-16 You will then beasked where to publish the web service Choose the WebServices folder in Local IIS, as indicated inFigure 13-17
Trang 14Figure 13-16
Figure 13-17358
Trang 15The next window, Publish Web Site (shown in Figure 13-18), enables you to configure a number of tures In our example, you can simply use the default setting and click OK.
Trang 16Client Side
On the client side, you need to create a new instance of the SoapAuthenHeaderclass defined in theweb service and pass the username and password to this SoapAuthenHeaderobject Then, pass thisSoapAuthenHeaderobject as the SoapAuthenHeaderValueproperty of the Serviceclass
First, create a new Windows Mobile 5 device application for Smartphone, name the project wsAuthClient,
and then add the web service created on the server side by choosing Project➪Add Web Reference
In the preceding example, the web reference is named spirit, which happens to be the name of the IISserver Obviously, you should name the web reference anything you like, as long as it is meaningful toyour code
From the Form Designer, add two text boxes and two labels to the form Name the first text box
txtNameInput and the second text box txtPasswdInput These will be used to pass the username and password to the SOAP header Add a menu item to the left soft key and name it mnuQuit with the Textproperty set to Quit Next, add another menu item to the right soft key and name it mnuConnect with
the Textproperty set to Connect Figure 13-20 shows the user interface of the sample application
Figure 13-20
After a user inputs the username and password and clicks the Connect menu, a new web proxy is created
by calling the Service()method of the web reference:
//Create a new web proxyspirit.Service ws = new spirit.Service();
360
Trang 17Now create a new SOAP header, AuthHeader, and pass the Textproperties of both text boxes to theSOAP header, as follows:
spirit.SoapAuthenHeader AuthHeader = new spirit.SoapAuthenHeader();
string resp = ws.SimpleAuthen();
Following is the full listing of the code:
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}private void mnuQuit_Click(object sender, EventArgs e){
Application.Exit();
}//Connect to the web serviceprivate void mnuConnect_Click(object sender, EventArgs e){
//Create a new web proxyspirit.Service ws = new spirit.Service();
spirit.SoapAuthenHeader AuthHeader = new spirit.SoapAuthenHeader();AuthHeader.username = txtNameInput.Text;
AuthHeader.password = txtPasswdInput.Text;
ws.SoapAuthenHeaderValue = AuthHeader;
string resp = ws.SimpleAuthen();
Trang 18}}}
Note that the preceding code works only if the client side can connect to the IIS server through the work From our experiences, we have found that using the IP address of the server that provides the webservice has a better chance of success than using the computer name or DNS name of the web server
net-Summar y
In this chapter you learned how to encrypt data and files with the classes in the System.Security.Cryptographynamespace, and how to enable password protection and data encryption in a SQLServer Mobile database For mobile devices with limited computer power and RAM, you should cau-tiously pick the encryption algorithms without sacrificing too much performance
Various techniques to secure the communication channel were discussed in this chapter We recommendthat you apply SSL and a VPN in your application to prevent potential data leaks The bottom line is,you do not want intruders to hack into your communication with ease and steal the confidential infor-mation, whether it is corporate or personal
User authentication certainly can help you enhance security, but most of the authentication methods arehighly correlated with the hardware or software platform used The custom SOAP header is a hardware-and software-independent approach to implementing user authentication You are encouraged to applythis approach only in a secured communication channel to avoid the theft of usernames and passwords
362
Trang 19Globalization and
Localization
Advances in information technologies increasingly enable the international community to becomeconnected As a result, you are likely to need to develop an application that can be used by peoplearound the world, who speak different languages and come from different cultural backgrounds.Indeed, many U.S.-based Fortune 500 corporations have offices not only in North America but also
in Europe, Asia, and beyond Instead of developing one application for one specific region, it makesmore sense to design and implement a “world-ready” application that can be easily localized Theadvantages are obvious: a fast and cost-effective development cycle, because you don’t need tostart from scratch when transforming English-based user interfaces to German- or Chinese-basedinterfaces
In this chapter, you will learn about the fundamental techniques available in Windows Mobile 5.0
to support world-ready applications, including the following:
❑ An overview of globalization and localization concepts
❑ Developing a culture-aware application
❑ Localizing data
❑ Best practices
Globalization and Localization Suppor t
In this book, the term globalization describes an application that is not bound to one particular
culture and can be used in multiple geographic locations In the NET Compact Framework 2.0,globalization is achieved by saving information in neutral data formats and storing a separate set
of resource files for each targeted culture or region
Trang 20The term localization refers to the process that customizes the user interface, text, and date format of an
application to a targeted culture Typical tasks of localization include translating strings into differentnatural languages, resizing UI elements, and redrawing images
To gain a better appreciation of the NET Compact Framework’s support for globalization and tion, you need a solid understanding of three concepts: cultures, satellite assemblies, and localized data
localiza-Culture
When talking about cultures in the context of software development and engineering, the focus is onlanguage, calendar, and data formats In RFC 1766, a hierarchical protocol is defined to distinguisheach different culture In the NET Compact Framework, a culture name has two parts: a neutral culturethat defines the language being used and an optional subculture that defines a geographic location Forinstance, “es” refers to Spanish, and whereas “es-PE” represents Spanish in Peru, “es-MX” representsSpanish in Mexico, and “es-ES” means Spanish in Spain Having a subculture in the culture name isnecessary because language itself is not sufficient to distinguish different cultures Another obviousexample is currency People from different countries or regions may speak the same language but use adifferent currency For example, Table 14-1 lists several culture names, locale IDs (LCIDs), and languagecode pages for both English and Chinese (For a full list of the table, please refer to the home page ofMicrosoft’s Global Developer Center at www.microsoft.com/globaldev/default.mspx.)
Table 14-1 Information of CulturesLocalized Cultural Codes
ANSI OEM LCID (HEX) Culture Name Locale Code Page Code Page
0x0804 zh-CN Chinese (People’s Republic of China) 936 936
364
Trang 21You can see that the cultures are organized first by the language and then by the geographical regions.
In addition to its name, each culture has a unique locale ID (LCID) Microsoft assigned LCIDs so that tures with the same language always have the same endings For example, the LCIDs of Chinese-speakingcultures end with 0x04, whereas the LCIDs of English-speaking cultures end with 0x09 Two sets of codepages are used in the NET Compact Framework The ANSI code page is used for applications using aGUI, and the OEM code page is used for applications using a character-based interface
cul-On a Smartphone device with Windows Mobile support, users can change cultures by selecting Start➪Settings➪More➪Regional Settings If the operating system has additional language support, users canfurther change their default language on the device
The CultureInfo Class
To retrieve and set cultures on Windows Mobile devices, the NET Framework provides the CultureInfoclass, which is defined in the System.Globalizationnamespace Two static properties, CurrentCultureand CurrentUICulture, are available to get and set the current culture information In most cases,CurrentCultureand CurrentUICultureare identical The two methods return different results onlywhen users have installed Multilingual Language Interface (MUI) and chosen a language that is differentfrom the locale For example, a British software developer assigned to the Germany branch for systemsintegration will probably need to install the German MUI on the PC In this situation, the CurrentCultureproperty is still English while the CurrentUICultureproperty is set to Germany
The NET Compact Framework supports only a subset of the CultureInfoclass, and the CurrentCultureproperty is set to read-only, implying that you are not supposed to change the culture for each differentprocess or thread The philosophy behind this is simple: Mobile devices are normally used by a singleuser, who probably prefers to stick to one common default setting
The following code snippet shows how to use the CultureInfoclass to retrieve the current culturesettings:
Using System.Globalization;
CultureInfo curCulture = CultureInfo.CurrentCulture;
string cultureName = “Name: “+curCulture.Name+”\t Locale”+curCulture.EnglishName;MessageBox.show(cultureName);
Because the CurrentCultureproperty is read-only in the NET Compact Framework, you cannot ply assign a value to CurrentCultureand hope that you can change the culture settings Instead, youshould create a new instance of the CultureInfoclass with the desired culture
sim-The CultureInfoclass constructor supports four overloads:
❑ Public CultureInfo (int culture)
❑ Public CultureInfo (string name)
❑ Public CultureInfo (int culture , bool useUserOverride)
❑ Public CultureInfo (string name, bool useUserOverride)
Trang 22The first two constructors will change the culture settings once a new CultureInfoobject is ated Sometimes, however, you do not want a newly created CultureInfoobject conflicting with yoursystem’s default culture settings If that is the case, use either of the last two constructors and set theBoolean parameters to false Note that if you create an instance of CultureInfothat represents aculture unsupported by the NET Compact Framework or the device’s operating system, then anArgumentExceptionwill be thrown.
instanti-The following sample code will create a new CultureInfoinstance and change the culture settings toEnglish (United Kingdom), regardless of the previous culture setting:
Using System.Globalization;
CultureInfo newCulture = new CultureInfo(“en-GB”);
Developing a Wor ld-Ready Application
In this section you will learn how to develop a world-ready application by using C#’s resource editorsand managers
When developing a world-ready application, you want to construct it so that it can be easily adapted
to different cultures without reinventing and redesigning the whole thing In the NET Compact
Framework, this is achieved by having a single globalized code base to deal with the logical flow andother common tasks Then, each culture-specific dynamic linked library (DLL) will be loaded duringruntime so that the application can display localized, culture-specific content
Figure 14-1 illustrates the approach An application named MuiApp has a single code base MuiApp.exeand common resources libraries, all saved in an application folder named MuiAppDir Three satelliteassemblies are created and saved into three different folders, each corresponding to one culture setting Intuitively, you can identify the modules on the left as the globalized modules, whereas the modules onthe right are the localized modules
Creating Localized Resources
Culture-specific satellite assemblies can be created as embedded resources so that the operating systemruntime can determine which resources file to load based on the culture setting Three formats areaccepted when you create a resource file: You can write a text file or an XML file, or you can compile abinary resource file directly The text file has a txtextension, the XML file has an extension of resx,
and the binary file has an extension of resource Note that only binary resource files can be embeddedduring runtime However, because binary files are too hard to read, maintain, and debug, it is highly rec-ommended that you edit the resource file using the XML format
366
Trang 23Figure 14-1
To create a culture-specific satellite assembly, an XML-formatted resource file needs to be compiled tothe binary format and then linked to the application Prior to Visual Studio 2005, you needed command-line tools to compile and link a resource file The NET-based utility to compile an XML-formattedresource file is resgen.exe, which converts txtfiles and resxfiles to binary resourcesfiles Forexample, the following command converts the XML-formatted resource file App1.Resources.resxtothe binary-formatted resource file App1.Resources.resources:
RESGEN.EXE App1.Resources.resx App1.Resources.resourcesAfter compiling a resource file to binary format, you need to link the resource file to the assembly Prior
to Visual Studio 2005, a NET-based tool assembly linker, Al.exe, was typically used to achieve this Asample use of this command is as follows:
AL.EXE /t: library/out:Resources.resources.dll/link:Resources.resources
Application Folder
\MuiAppDir
MuiApp.exe
Common Resources.dll
Satellite AssemblyCulture-Specific Folders
Trang 24Alternatively, you could use the resource editors for C# provided to you as sample applications in VisualStudio NET 2003 With the release of Visual Studio 2005, a resource editor is integrated into the IDE,streamlining and simplifying the process of creating an XML-formatted resources file: You can visuallyedit an XML-formatted resources file and Visual Studio 2005 will automatically compile the file to abinary resxfile and link the binary-formatted resources file to the application.
To add a new resource file to a project, right-click the project from Solution Explorer, and then chooseAdd➪New Item (see Figure 14-2)
Figure 14-2
When the Add New Item wizard appears, choose Resources File and name the resxresources file to
whatever you feel is appropriate — for example, Resource1.resx, as shown in Figure 14-3 After the
resources file is added to the project, you can double-click the file to edit it The resources editor inVisual Studio 2005 currently enables you to edit strings and to add or remove strings, images, or otherobjects Figure 14-4 shows a resources file named Resources.resxthat contains two strings The stringvalue of Captionis Regional Settingsand the string value of WelcomStris Welcome to WindowsMobile 5.0!
368
Trang 25Figure 14-3
Figure 14-4
Now that you know how to add a resources file to a C# project, the next section describes how to use thisresources file for localization purposes
Trang 26A Sample Application with a Localized Satellite Assembly
In this section you will create a sample world-ready application that uses the localized satellite blies The function of this application is straightforward: When a user changes the culture preferences,the UI will display a welcome message in the language the user specified To highlight the programmingtechniques, this sample application will enable the user to switch between English and Chinese
assem-Start a new Windows Mobile 5.0 Smartphone device application from Visual Studio 2005 and name the
project MUIWelcome Rename the default Form1 to MUIForm and change the caption of the form to
Welcome Add two Label controls, label1 and label2, to MUIForm Then add to MUIForm a ComboBox
control comboBox1and a menu item menuiItem1with the caption Quit (see Figure 14-5)
Figure 14-5
label1is used to display the welcome message, and label2serves as the caption to the comboBox1.From the Properties window of comboBox1, add en-USand en-CNto the Itemscollection so that at run-time a user can use comboBox1to choose the language settings for the user interface of the sample appli-cation To make the Textvalues of both label1and label2culture specific, this application separatesChinese culture content from the main code and compiles it to a separate resources file
370