﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-时间的痕迹-文章分类-Windows Mobile开发</title><link>http://www.cppblog.com/ivenher/category/763.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 20 May 2008 11:51:44 GMT</lastBuildDate><pubDate>Tue, 20 May 2008 11:51:44 GMT</pubDate><ttl>60</ttl><item><title>VS.NET 2003开发移动Web应用 六</title><link>http://www.cppblog.com/ivenher/articles/2542.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:59:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2542.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2542.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2542.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2542.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2542.html</trackback:ping><description><![CDATA[<TABLE id=txsite_content cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD class=content>
<P align=right><A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>上一页</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230.html"><FONT color=#3366cc>1</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>2</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>3</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>4</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>5</FONT></A> <FONT color=red>6</FONT> </P>　　<B>移动<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>图像</B><BR><BR>　　移动.NET在不同设备类型上显示不同图像的类型。 <BR><BR>　　Image控件<BR><BR>　　不同的移动设备显示的兼容性不同。<BR><BR>　　Image控件允许开发者为不同的设备类型指定图像的不同类型。<BR><BR>　　Image类型<BR><BR>　　有些移动设备显示GIF图像，有些显示BMP或者WBM图像，Image控件允许你为每个适合的图像类型指定不同的图像。<BR><BR>　　这个移动页面显示一个图像：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page<BR>Inherits=<BR>"System.<A href="http://dev.21tx.com/web/" target=_blank><FONT color=#3366cc>Web</FONT></A>.UI.MobileControls.MobilePage"%＞<BR>＜%@ Re<A href="http://dev.21tx.com/corp/gis/" target=_blank><FONT color=#3366cc>GIS</FONT></A>ter<BR>TagPrefix="Mobile"<BR>Namespace="System.Web.UI.MobileControls"<BR>Assembly="System.Web.Mobile" %＞<BR>＜Mobile:Form runat="server"＞<BR>＜Mobile:Image runat="server"＞<BR>＜DeviceSpecific＞<BR>＜Choice ImageURL="image.gif" /＞<BR>＜Choice ImageURL="image.bmp" /＞<BR>＜Choice ImageURL="image.wbmp" /＞<BR>＜/DeviceSpecific＞<BR>＜/Mobile:Image＞<BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　当这个页面显示在Pocket PC上的时候，将显示成GIF图像。在<A href="http://mobile.21tx.com/" target=_blank><FONT color=#3366cc>手机</FONT></A>上将根据收集的特性显示成WBMP或者BMP图像。<BR><BR>　　<B>移动.NET Utility</B><BR><BR>　　Utility控件通过很少的代码支持复杂的用户界面。<BR><BR>　　<B>Adrotator 控件</B><BR><BR>　　这个移动页面显示不同的广告：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page<BR>Inherits=<BR>"System.Web.UI.MobileControls.MobilePage"%＞<BR>＜%@ Register<BR>TagPrefix="Mobile"<BR>Namespace="System.Web.UI.MobileControls"<BR>Assembly="System.Web.Mobile" %＞<BR>＜Mobile:Form runat="server"＞<BR>＜Mobile:AdRotator runat="server"<BR>AdvertisementFile="advertisements.<A href="http://dev.21tx.com/web/xml/" target=_blank><FONT color=#3366cc>XML</FONT></A>"＞<BR>＜/Mobile:AdRotator＞<BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　这个是广告(ad)文件叫做“advertisements.xml”：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜?xml version="1.0" ?＞<BR>＜Advertisements＞<BR>＜Ad＞<BR>＜ImageUrl＞image1.gif＜/ImageUrl＞<BR>＜BmpImageUrl＞image1.bmp＜/BmpImageUrl＞<BR>＜WBmpImageUrl＞image1.wbmp＜/WBmpImageUrl＞<BR>＜NavigateUrl＞http://www.1.com＜/NavigateUrl＞<BR>＜AlternateText＞Visit 1＜/AlternateText＞<BR>＜/Ad＞<BR>＜Ad＞<BR>＜ImageUrl＞image2.gif＜/ImageUrl＞<BR>＜BmpImageUrl＞image2.bmp＜/BmpImageUrl＞<BR>＜WBmpImageUrl＞image2.wbmp＜/WBmpImageUrl＞<BR>＜NavigateUrl＞http://www.2.com＜/NavigateUrl＞<BR>＜AlternateText＞Visit 2＜/AlternateText＞<BR>＜/Ad＞<BR>＜Ad＞<BR>＜ImageUrl＞image3.gif＜/ImageUrl＞<BR>＜BmpImageUrl＞image3.bmp＜/BmpImageUrl＞<BR>＜WBmpImageUrl＞image3.wbmp＜/WBmpImageUrl＞<BR>＜NavigateUrl＞http://www.3.com＜/NavigateUrl＞<BR>＜AlternateText＞Visit 3＜/AlternateText＞<BR>＜/Ad＞<BR>＜/Advertisements＞</TD></TR></TBODY></TABLE><BR>　　<B>日历控件</B><BR><BR>　　这个也动页面显示一个日历：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page<BR>Inherits=<BR>"System.Web.UI.MobileControls.MobilePage"%＞<BR>＜%@ Register<BR>TagPrefix="Mobile"<BR>Namespace="System.Web.UI.MobileControls"<BR>Assembly="System.Web.Mobile" %＞<BR>＜script runat="server"＞<BR><BR>Sub CalChanged(sender as Object,e as EventArgs)<BR>lab1.Text="You selected " &amp; c1.SelectedDate<BR>ActiveForm=f2<BR>End Sub<BR><BR>＜/script＞<BR><BR>＜Mobile:Form id="f1" runat="server"＞<BR>＜Mobile:Calendar id="c1"<BR>OnSelectionChanged="CalChanged" runat="server" /＞<BR>＜/Mobile:Form＞<BR><BR>＜Mobile:Form id="f2" runat="server"＞<BR>＜Mobile:Label id="lab1" runat="server" /＞<BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　这个例子里日历显示在第一个表单里，当用户从日历里面选择数据时，选择的日期显示在新的页面里。<BR><BR>　　PhoneCall控件<BR><BR>　　当用户选择文本这个移动页面显示文本“Tove’s number”和电话号码(555)555-5555。<BR><BR>　　The PhoneCall Control<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page<BR>Inherits=<BR>"System.Web.UI.MobileControls.MobilePage"%＞<BR>＜%@ Register<BR>TagPrefix="Mobile"<BR>Namespace="System.Web.UI.MobileControls"<BR>Assembly="System.Web.Mobile" %＞<BR>＜Mobile:Form runat="server"＞<BR><BR>＜Mobile:PhoneCall runat="server"<BR>PhoneNumber="(555) 555-5555"<BR>Text="Tove's number"<BR>AlternateFormat="{0}" /＞<BR><BR>＜/Mobile:Form＞<BR></TD></TR></TBODY></TABLE><BR>　　这里的属性”AllternateFormat”是{0}。设置成这种显示将会显示为文本状。<BR><BR>　　如果你是用值{1}它将显示成”PhoneNumber”。<BR><BR>　　你也可以实用如下的构作AlternateFormat =”{0}is{1}”.这时候将会显示“Tove's number is (555) 555-5555”。<BR><BR>　　<B>Utility 控件</B><BR><BR>
<TABLE cellSpacing=0 width="52%" border=1>
<TBODY>
<TR>
<TD>Name</TD>
<TD>Function</TD></TR>
<TR>
<TD>AdRotator</TD>
<TD>Displays advertisements</TD></TR>
<TR>
<TD>Calendar</TD>
<TD>Displays a calendar</TD></TR>
<TR>
<TD>PhoneCall</TD>
<TD>Calls a telephone number</TD></TR></TBODY></TABLE><BR>　　要了解更多的信息参考MSDN。<BR></TD></TR></TBODY></TABLE><img src ="http://www.cppblog.com/ivenher/aggbug/2542.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:59 <a href="http://www.cppblog.com/ivenher/articles/2542.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS.NET 2003开发移动Web应用 五</title><link>http://www.cppblog.com/ivenher/articles/2541.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:58:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2541.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2541.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2541.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2541.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2541.html</trackback:ping><description><![CDATA[<P align=right><A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>上一页</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230.html"><FONT color=#3366cc>1</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>2</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>3</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>4</FONT></A> <FONT color=red>5</FONT> <A href="http://www.21tx.com/dev/2003/11/03/10230_5.html"><FONT color=#3366cc>6</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_5.html"><FONT color=#3366cc>下一页</FONT></A> </P>　　<B>移动<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>列表</B><BR><BR>　　移动列表控件支持不同的输入和显示特性。 <BR><BR>　　从List中选择<BR><BR>　　这个页面有两个表单： <BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page <BR>Inherits= <BR>"System.<A href="http://dev.21tx.com/web/" target=_blank><FONT color=#3366cc>Web</FONT></A>.UI.MobileControls.MobilePage"%＞ <BR>＜%@ Re<A href="http://dev.21tx.com/corp/gis/" target=_blank><FONT color=#3366cc>GIS</FONT></A>ter <BR>TagPrefix="Mobile" <BR>Namespace="System.Web.UI.MobileControls" <BR>Assembly="System.Web.Mobile" %＞ <BR>＜script runat="server"＞ <BR>Sub Show_Price(sender As Object,e As ListCommandEventArgs) <BR>text1.Text=e.ListItem.Text &amp; "=" &amp; e.ListItem.Value <BR>ActiveForm=f2 <BR>End Sub <BR><BR>＜/script＞ <BR><BR>＜Mobile:Form id="f1" runat="server"＞ <BR>＜Mobile:List runat="server" <BR>OnItemCommand="Show_Price"＞ <BR>＜Item text="Volvo" value="$30,000" /＞ <BR>＜Item text="BMW" value="$32,000" /＞ <BR>＜Item text="Audi" value="$34,000" /＞ <BR>＜/Mobile:List＞ <BR>＜/Mobile:Form＞ <BR><BR>＜Mobile:Form id="f2" runat="server"＞ <BR>＜Mobile:Label runat="server" id="text1" /＞ <BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　第一个表单有一个车的列表。 <BR><BR>　　第二个页面显示价钱。当在第一个页上选择一个车这个页面就被激活。 <BR><BR>　　当这个应用程序运行在移动的设备上这两个页面看起来就像下面的： <BR><IMG hspace=3 src="http://image.21tx.com/image/20031103/10057.gif" align=center vspace=1 border=1><BR><BR>　　<B>移动.NET选择列表</B><BR><BR>　　SelectionList控件支持下拉框，复选框以及单选按钮。 <BR><BR>　　SelectionList<BR><BR>　　这个移动页面使用SelectionList让用户选择车： <BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page<BR>Inherits=<BR>"System.Web.UI.MobileControls.MobilePage"%＞<BR>＜%@ Register<BR>TagPrefix="Mobile"<BR>Namespace="System.Web.UI.MobileControls"<BR>Assembly="System.Web.Mobile" %＞ <BR>＜script runat="server"＞<BR>Sub Car_Click(sender as Object, e as EventArgs)<BR>ActiveForm=f2<BR>t1.text=cars.Selection.Value<BR>End Sub<BR>＜/script＞ <BR>＜Mobile:Form id="f1" runat="server"＞<BR>＜Mobile:SelectionList runat="server" id="cars" ＞<BR>＜Item Text="Volvo" Value="$30,000" /＞<BR>＜Item Text="BMW" Value="$32,000" /＞<BR>＜Item Text="Audi" Value="$34,000" /＞<BR>＜/Mobile:SelectionList＞<BR>＜Mobile:Command runat="server"<BR>OnClick="Car_Click" Text="Submit" /＞<BR>＜/Mobile:Form＞ <BR>＜Mobile:Form id="f2" runat="server"＞<BR>＜Mobile:Label id="t1" runat="server" /＞<BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　当这个页面显示在移动设备上的时候，页面的导航和显示功能将为不同的设备编译不同的显示特性。（译者注：设备不同看到的页面也不同但是功能是一样的） <BR><BR>　　有些设备，比如<A href="http://www.21tx.com/pda/" target=_blank><FONT color=#3366cc>掌上电脑</FONT></A>，它可能显示成下拉列表选择表单。在<A href="http://mobile.21tx.com/" target=_blank><FONT color=#3366cc>手机</FONT></A>上它可能显示为一个选项列表的选择表单。 <BR><img src ="http://www.cppblog.com/ivenher/aggbug/2541.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:58 <a href="http://www.cppblog.com/ivenher/articles/2541.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS.NET 2003开发移动Web应用 四</title><link>http://www.cppblog.com/ivenher/articles/2540.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:56:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2540.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2540.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2540.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2540.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2540.html</trackback:ping><description><![CDATA[<P align=right><A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>上一页</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230.html"><FONT color=#3366cc>1</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>2</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>3</FONT></A> <FONT color=red>4</FONT> <A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>5</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_5.html"><FONT color=#3366cc>6</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>下一页</FONT></A> </P>　　<STRONG>移动<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>输入验证</STRONG><BR><BR>　　验证控件用来验证用户输入的数据。 <BR><BR>　　验证控件<BR><BR>　　验证控件用来验证用户输入的数据。 <BR><BR>　　验证控件允许你去验证输入控件（比如：TextBox）并且当验证失败的时候显示消息。 <BR><BR>　　每个验证控件完成特定类型的验证（比如：不是指定的值或者不是指定的范围）。 <BR><BR>　　默认情况下，当命令控件被点击得失后页面验证才处理。设置控件的CausesValidation属性为false后当控件被点击时你可以阻止页面的验证（和<A href="http://dev.21tx.com/web/asp/" target=_blank><FONT color=#3366cc>ASP</FONT></A>.NET的模式一样设置命令控件（可能激发<A href="http://www.21tx.com/server/" target=_blank><FONT color=#3366cc>服务器</FONT></A>事件的）的CausesValidation可以不用激发验证逻辑）。 <BR><BR>　　验证输入<BR><BR>　　这个页面包含两个表单： <BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page <BR>Inherits= <BR>"System.<A href="http://dev.21tx.com/web/" target=_blank><FONT color=#3366cc>Web</FONT></A>.UI.MobileControls.MobilePage"%＞ <BR>＜%@ Re<A href="http://dev.21tx.com/corp/gis/" target=_blank><FONT color=#3366cc>GIS</FONT></A>ter <BR>TagPrefix="Mobile" <BR>Namespace="System.Web.UI.MobileControls" <BR>Assembly="System.Web.Mobile" %＞ <BR>＜script runat="server"＞ <BR><BR>Sub Page2(Sender as Object,E as EventArgs) <BR>If Page.IsValid Then <BR>ActiveForm=f2 <BR>text2.Text="You are " &amp; age.text &amp; " years old" <BR>end if <BR>End Sub <BR><BR>＜/script＞ <BR><BR>＜Mobile:Form id="f1" runat="server"＞ <BR>＜Mobile:CompareValidator runat="server" <BR>ControlToValidate="age" <BR>Type="Integer" <BR>ValueToCompare="18" <BR>Operator="GreaterThanEqual"＞ <BR>You must be at least 18 <BR>＜/Mobile:CompareValidator＞ <BR><BR>＜Mobile:Label runat="server"＞Age?＜/Mobile:Label＞ <BR>＜Mobile:TextBox id="age" runat="server" /＞ <BR>＜Mobile:Command OnClick="Page2" runat="server"＞ <BR>Submit＜/Mobile:Command＞ <BR>＜/Mobile:Form＞ <BR><BR>＜Mobile:Form id="f2" runat="server"＞ <BR>＜Mobile:Label id="text2" runat="server" /＞ <BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　第一个表单有一个Text属性是Age的Label控件，一个输入年龄的输入框以及一个提交按钮。 <BR><BR>　　通过点击第一个页面的提交按钮后第二个页面被激活，显示相应。 <BR><BR>　　如果验证输入错误，错误消息被显示出来。 <BR><BR>　　当应用程序运行在移动设备上，这两个页面看起来象下面的样子： <BR><BR><IMG hspace=3 src="http://image.21tx.com/image/20031103/10067.gif" align=center vspace=1 border=1><BR><BR>　　ValidationSummary 控件<BR><BR>　　前面的例子使用CompareValidator控件验证输入的信息。输入信息的验证通过验证控件的属性ContolToValidate定义。 <BR><BR>　　你也可以实用ValidationSummary控件的属性FormToValidate，去验证表单里的所有的输入信息。（功能和<A href="http://dev.21tx.com/dotnet/aspnet/" target=_blank><FONT color=#3366cc>ASP.NET</FONT></A>一样） <BR><BR>　　这种方式你可以用错误的摘要信息替换原来的单个错误显示。 <BR><BR>　　验证控件参考<BR><BR>
<TABLE cellSpacing=0 width="66%" border=1>
<TBODY>
<TR>
<TD>Name</TD>
<TD>Function</TD></TR>
<TR>
<TD>CompareValidator</TD>
<TD>Compares two values</TD></TR>
<TR>
<TD>CustomValidator</TD>
<TD>Provides custom validation</TD></TR>
<TR>
<TD>RangeValidator</TD>
<TD>Validates a range</TD></TR>
<TR>
<TD>RegularExpressionValidator</TD>
<TD>Validates an expression</TD></TR>
<TR>
<TD>RequiredFieldValidator</TD>
<TD>Validates required data</TD></TR>
<TR>
<TD>ValidationSummary</TD>
<TD>Displays a validation summary</TD></TR></TBODY></TABLE><BR>　　要得到包括属性方法、事件以及更多实例的控件完整参考，请参考”Mobile Reference”页面。（译者注：参考原始页面或者MSDN。） <img src ="http://www.cppblog.com/ivenher/aggbug/2540.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:56 <a href="http://www.cppblog.com/ivenher/articles/2540.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS.NET 2003开发移动Web应用 三</title><link>http://www.cppblog.com/ivenher/articles/2539.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:55:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2539.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2539.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2539.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2539.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2539.html</trackback:ping><description><![CDATA[<P align=right><A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>上一页</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230.html"><FONT color=#3366cc>1</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>2</FONT></A> <FONT color=red>3</FONT> <A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>4</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>5</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_5.html"><FONT color=#3366cc>6</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>下一页</FONT></A> </P>　　<B>移动<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>输入</B><BR><BR>　　输入控件<BR><BR>　　有很多的移动控件支持用户输入。<BR><BR>　　在前面的demo中，最长用的输入控件可能就是TextBox控件了。TextBox是完成一些简单的输入，比如像姓名，数量，以及标识符和关键字。<BR><BR>　　如果输入大量的文本那么TextView控件可能是更好的选择。TextView控件允许长的多行的输入就像你用MSN给其他人发消息一样。<BR><BR>　　数字输入<BR><BR>　　我们可以通过设置TextBox的属性Numeric让TextBox只接收来接收数字的输入信息。<BR><BR>　　注意：这个特性通常工作在通过改变从文字到数字的输入模式的<A href="http://mobile.21tx.com/" target=_blank><FONT color=#3366cc>手机</FONT></A>上。然而在HTML的浏览器上，通常不支持这种行为。<BR><BR>　　密码输入<BR><BR>　　我们可以将TextBox控件的Password属性设置成true或者false来指定TextBox处理密码字段。<BR><BR>　　密码字段将会通过*（星号）替换原始的文本来隐藏输入信息。<BR><BR>　　列表控件<BR><BR>　　TextBox和TextView控件是非常适合输入信息的，但是有时你想让用户从已有的列表中选择事先定义好的值。<BR><BR>　　SelectionList控件支持下拉列表，复选选框和单选按钮。这部分的内容将在其他的章节介绍。<BR><BR>　　List控件支持菜单和列表的选项，List控件将会在其他的章节介绍。<BR><BR>　　用户界面控件<BR><BR>　　用户控件是显示用户界面的控件集。<BR><BR>
<TABLE cellSpacing=0 width="72%" border=1>
<TBODY>
<TR>
<TD>Name</TD>
<TD>Function</TD></TR>
<TR>
<TD>Command</TD>
<TD>Performs an action</TD></TR>
<TR>
<TD>Form</TD>
<TD>Defines a container for mobile controls</TD></TR>
<TR>
<TD>Image</TD>
<TD>Defines an image</TD></TR>
<TR>
<TD>Label</TD>
<TD>Defines a text</TD></TR>
<TR>
<TD>Link</TD>
<TD>Defines a hy<A href="http://dev.21tx.com/web/perl/" target=_blank><FONT color=#3366cc>Perl</FONT></A>ink</TD></TR>
<TR>
<TD>List</TD>
<TD>Defines a list</TD></TR>
<TR>
<TD>MobilePage</TD>
<TD>Defines a container for mobile controls</TD></TR>
<TR>
<TD>ObjectList</TD>
<TD>Defines a list of data objects</TD></TR>
<TR>
<TD>Panel</TD>
<TD>Defines a container for other controls</TD></TR>
<TR>
<TD>SelectionList</TD>
<TD>Defines a list to select from</TD></TR>
<TR>
<TD>StyleSheet</TD>
<TD>Defines styles to be applied to other controls</TD></TR>
<TR>
<TD>TextBox</TD>
<TD>Defines a single line input box</TD></TR>
<TR>
<TD>TextView</TD>
<TD>Defines a multi-line input box </TD></TR></TBODY></TABLE><BR><img src ="http://www.cppblog.com/ivenher/aggbug/2539.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:55 <a href="http://www.cppblog.com/ivenher/articles/2539.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS.NET 2003开发移动Web应用 二</title><link>http://www.cppblog.com/ivenher/articles/2538.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:50:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2538.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2538.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2538.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2538.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2538.html</trackback:ping><description><![CDATA[<P align=right><A href="http://www.21tx.com/dev/2003/11/03/10230.html"><FONT color=#3366cc>上一页</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230.html"><FONT color=#3366cc>1</FONT></A> <FONT color=red>2</FONT> <A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>3</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>4</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>5</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_5.html"><FONT color=#3366cc>6</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>下一页</FONT></A> </P><BR><BR>　　<B>移动<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>事件</B><BR><BR>　　移动控件有一个可对属性，方法和事件编程的对象模型。<BR><BR>　　要得到完整的信息请参考MSDN。<BR><BR>　　提交文本<BR><BR>　　这个页面有两个表单：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>＜%@ Page<BR>Inherits=<BR>"System.<A href="http://dev.21tx.com/web/" target=_blank><FONT color=#3366cc>Web</FONT></A>.UI.MobileControls.MobilePage"%＞<BR>＜%@ Re<A href="http://dev.21tx.com/corp/gis/" target=_blank><FONT color=#3366cc>GIS</FONT></A>ter<BR>TagPrefix="Mobile"<BR>Namespace="System.Web.UI.MobileControls"<BR>Assembly="System.Web.Mobile" %＞<BR>＜script runat="server"＞<BR>Dim age<BR><BR>Sub AgeClick(sender As Object, e As EventArgs)<BR>age=text1.Text<BR>ActiveForm=Form2<BR>End Sub<BR>Sub Form2_Activate(sender As Object,e As EventArgs)<BR>message.Text="You are " &amp; age &amp; " years old"<BR>End Sub<BR>＜/script＞<BR><BR>＜Mobile:Form id="form1" runat="server"＞<BR>＜Mobile:Label runat="server"＞Age?＜/Mobile:Label＞<BR>＜Mobile:TextBox runat="server" id="text1" /＞<BR>＜Mobile:Command runat="server" OnClick="AgeClick" Text="Submit" /＞<BR>＜/Mobile:Form＞<BR><BR>＜Mobile:Form id="form2" runat="server" OnActivate="Form2_Activate"＞<BR>＜Mobile:Label runat="server" id="message" /＞<BR>＜/Mobile:Form＞</TD></TR></TBODY></TABLE><BR>　　当一个页面有两个表单的时候，第一个表单总是作为打开的默认表单。<BR><BR>　　第一个表单有一内容是Age的label控件，一个输入控件用来输入年龄(Age)以及一个提交（Submit）按钮。<BR><BR>　　第二个页面通过第一个页面的提交按钮激活（译者注：偶觉的是第二个Form通过第一个Form的提交按钮激活，而不是原文种的Page。），同时显示相应信息。<BR><BR>　　当应用程序运行在移动设备上的时候，这两个页面看起来就像下面：<BR><BR><IMG hspace=3 src="http://image.21tx.com/image/20031103/10062.gif" align=center vspace=1 border=1><BR><img src ="http://www.cppblog.com/ivenher/aggbug/2538.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:50 <a href="http://www.cppblog.com/ivenher/articles/2538.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS.NET 2003开发移动Web应用 一</title><link>http://www.cppblog.com/ivenher/articles/2537.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:48:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2537.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2537.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2537.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2537.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2537.html</trackback:ping><description><![CDATA[<TABLE id=txsite_content cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD class=content>
<P align=right><FONT color=red>1</FONT> <A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>2</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_2.html"><FONT color=#3366cc>3</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_3.html"><FONT color=#3366cc>4</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_4.html"><FONT color=#3366cc>5</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_5.html"><FONT color=#3366cc>6</FONT></A> <A href="http://www.21tx.com/dev/2003/11/03/10230_1.html"><FONT color=#3366cc>下一页</FONT></A> </P><BR><BR>　　<B>背景</B><BR><BR>　　<A href="http://mobile.21tx.com/" target=_blank><FONT color=#3366cc>手机</FONT></A>(移动电话)已经成为我们生活的一部分,一些新的设备添加到其中比如:PalmPilot,Pocket PC以及马上产生的AutoPC。<BR><BR>　　幸运的是这些新的移动设备都可以连接网络或者执行应用程序.<BR><BR>　　现在的移动应用程序被开发成可以传递数据的任何类型给世界上任何地方的任何人.<BR><BR>　　不同的移动设备支持不同的编程语言.有些支持WAP和WML,有些则支持HTML或者受限制的HTML,还有些同时支持以上两种或者其他不同的语言.<BR><BR>　　为了支持所有类型的移动设备,开发人员不得不为每一种语言创建不同的应用程序.<BR><BR>　　移动的<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>,微软已经为移动应用程序的开发生产了新的平台.<BR><BR>　　该向导是一个关于如何运用扩展的.NET框架开发移动应用程序,叫做MMIT(Microsoft Mobile Internet Toolkit)或者简单的叫做移动.NET(.NET Mobile).<BR>　　<B>移动.NET(.NET Mobile)</B><BR><BR>　　移动.NET是微软<A href="http://dev.21tx.com/web/asp/" target=_blank><FONT color=#3366cc>ASP</FONT></A>.NET和微软.NET框架的扩展.<BR><BR>　　移动.NET是一组用来来创建应用程序的<A href="http://www.21tx.com/server/" target=_blank><FONT color=#3366cc>服务器</FONT></A>端的<A href="http://dev.21tx.com/web/" target=_blank><FONT color=#3366cc>Web</FONT></A> Forms控件,比如:Web电话和PDA.<BR><BR>　　那些控件通过产生WML1.1,HTNL3.2或者简单的(compact)HTML给不同的设备呈现不同的输出.(译者注:就是对应不同设备的不同呈现.)<BR><BR>　　<B>如何工作</B><BR><BR>　　下面的表格显示了移动.NET是如何工作的:<BR><BR>
<TABLE cellSpacing=0 width="26%" border=1>
<TBODY>
<TR>
<TD>移动设备</TD></TR>
<TR>
<TD>Internet网络</TD></TR>
<TR>
<TD>IIS服务</TD></TR>
<TR>
<TD>.NET框架</TD></TR>
<TR>
<TD><A href="http://dev.21tx.com/dotnet/aspnet/" target=_blank><FONT color=#3366cc>ASP.NET</FONT></A></TD></TR>
<TR>
<TD>移动.NET</TD></TR></TBODY></TABLE><BR>　　1. web客户端请求web页面.<BR><BR>　　2. internet上传送该请求.<BR><BR>　　3. 通过IIS接收该请求.<BR><BR>　　4. 通过.NET框架处理该请求.<BR><BR>　　5. 通过ASP.NET编译请求的页面.<BR><BR>　　6. 移动.NET处理任何移动设备的要求.( .NET Mobile handles any mobile device requirements)(译者注:这里处理详细的设备信息,以及该如何呈现页面)<BR><BR>　　7. 页面被返回给客户端.<BR><BR>　　<B>软件要求</B><BR><BR>　　要使用移动.NET开发移动的应用程序,你必须拥有下面的环境或者组件:<BR><BR>　　1. 带IIS5的<A href="http://dev.21tx.com/os/windows/" target=_blank><FONT color=#3366cc>Windows</FONT></A> 2000 Professional 或者Server <BR><BR>　　2. 所有的Windows 2000的补丁.<BR><BR>　　3. ASP.NET框架(译者注:.NET 框架).<BR><BR>　　4. 微软移动网络工具包(Microsoft Mobile Internet Toolkit MMIT).<BR><BR>　　5. IE 6.0或者5.5<BR><BR>　　6. 你喜欢的模拟器.<BR><BR>　　你许要使用Windows 2000开发.NET应用程序.同时你还必须安装Windows 2000的所有补丁程序.<BR><BR>IIS 5(Internet Information Service)是Windows 2000的一部分.<BR><BR>　　如果你想要了解更多的关于如何安装.NET的资料请去我们的ASP.NET tutorial.<BR><BR>　　你还要安装MMIT(.NET Mobile)和最新版本的IE浏览器.<BR><BR>　　IE和MMIT可以去这里Microsoft MSDN<A href="http://dl.21tx.com/" target=_blank><FONT color=#3366cc>下载</FONT></A>.<BR><BR>　　<B>如何开始</B><BR><BR>　　用ASP.NET开发移动Web应用程序非常简单:<BR><BR>　　1. 创建ASP.NET页面.<BR><BR>　　2. 加入命名控件System.Mobile.UI.(译者注:在VS2003不用这么麻烦,建立移动项目这些都已经做好了).<BR><BR>　　3. 添加移动控件到页面上.<BR></TD></TR></TBODY></TABLE><img src ="http://www.cppblog.com/ivenher/aggbug/2537.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:48 <a href="http://www.cppblog.com/ivenher/articles/2537.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows Mobile开发环境搭建指南 二</title><link>http://www.cppblog.com/ivenher/articles/2536.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:46:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2536.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2536.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2536.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2536.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2536.html</trackback:ping><description><![CDATA[<STRONG>ActiveSync环境搭建<BR><BR></STRONG>　　在完成了上述开发环境的搭建之后，您就可以在Visual Studio <A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>中开发和调试应用程序，并在设备/模拟器中进行部署。但是，如果您还需要进一步执行下述操作，那么请按本节所述继续搭建ActiveSync环境。可能的执行操作包括（但不限于）：<BR><BR>　　 向设备/模拟器中复制文件<BR><BR>　　 从设备/模拟器中删除文件<BR><BR>　　 与设备/模拟器同步数据<BR><BR>　　 开发和调试包含RAPI (Remote API)功能的应用<BR><BR>　　 ……<BR><BR>　　安装ActiveSync<BR><BR>　　ActiveSync是一款管理<A href="http://dev.21tx.com/os/windows/" target=_blank><FONT color=#3366cc>Windows</FONT></A> Mobile设备连接、与PC进行数据同步的工具。如果您开发时使用的是真实设备，则最好事先安装ActiveSync使之与PC机连接。如果您使用的是模拟器，则除了安装ActiveSync以外，还需要安装下述工具。<BR><BR>　　安装Connect Emulator with ActiveSync<BR><BR>　　如果您使用的是模拟器软件，除了安装ActiveSync外，还必须安装Connect Emulator with ActiveSync这款工具软件。它将使您可以直接通过ActiveSync连接到模拟器上。<BR><BR>　　<B>辅助工具介绍</B><BR><BR>　　除了上述基本开发工具以外，在<A href="http://dev.21tx.com/mobile/wince/" target=_blank><FONT color=#3366cc>Windows Mobile</FONT></A>开发社区中还存在着大量的辅助工具，包括应用程序框架、工具、控件等等。其中有一些由于定位准确、制作优良、使用方便，已经成为Windows Mobile开发不可或缺的好助手。以下列出其中的一部分，更多的还存在于Windows Mobile开发者社区及<A href="http://news.21tx.com/net/" target=_blank><FONT color=#3366cc>互联网</FONT></A>上，等待着您去发现。<BR><BR>　　OpenNETCF.org Smart Device <A href="http://dev.21tx.com/dotnet/framework/" target=_blank><FONT color=#3366cc>Framework</FONT></A><BR><BR>　　由几位长年活跃于Windows Mobile开发者社区的MVP共同开发的OpenNETCF.org Smart Device Framework (以下简称为SDF)，几天前刚刚获得了Pocket PC Magazine评出的2004年度最佳.NET开发框架大奖。熟悉SDF的开发者都会认为，对于这一奖项，OpenNETCF的确当之无愧，因为SDF几乎已经成了Windows Mobile开发者不可或缺的工具。他们对.NET CF的不足给出了及时的弥补，在SDF中，您可以找到Configuration、<A href="http://dev.21tx.com/web/xml/" target=_blank><FONT color=#3366cc>XML</FONT></A> Serialization、 Notification、Interop Services、WSE 2.0等一系列.NET CF当前版本尚未提供的功能，以及诸如ListBoxEx等优秀的控件。更值得一提的是，SDF是一项完全免费的开源项目。这几位MVP为整个Windows Mobile开发者社区所做的贡献也许真的无法用金钱来衡量。<BR><BR>　　<A href="http://dl.21tx.com/" target=_blank><FONT color=#3366cc>下载</FONT></A>地址：http://www.opennetcf.org。<BR><BR>　　Windows Mobile Developer Power Toys<BR><BR>　　这是微软继Pocket PC/Smartphone 2003 SDK之后为开发人员提供的另一套开发辅助工具集。其中包含不少非常值得一用的优秀工具，如：<BR><BR>　　 ActiveSync Remote Display：把连接在PC上的智能设备影像通过PC屏幕放大显示<BR><BR>　　 CECopy：以命令行的方式向所连接的智能设备传输文件<BR><BR>　　 Hopper：用于Pocket PC 2003的用户输入压力测试工具<BR><BR>　　 PPC Command Shell：用于Pocket PC 2003的命令行工具<BR><BR>　　 TypeIt：用于Smartphone 2003的辅助文字输入工具<BR><BR>　　 ……<BR><BR>　　Mobile Application Development Toolkit 2004<BR><BR>　　这是微软近期推出的Windows Mobile开发工具及资料集，其中包含上述所有产品及工具，以及一系列相关的文档、教程及参考资料。<BR><BR>　　<STRONG>结束语<BR></STRONG><BR>　　好了，对于如何搭建Windows Mobile的开发环境就介绍到这里了。可以肯定地说，随着微软公司支持力度的增加和Windows Mobile开发者社区的成熟，Windows Mobile开发将面临越来越有利的良好环境。<BR><img src ="http://www.cppblog.com/ivenher/aggbug/2536.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:46 <a href="http://www.cppblog.com/ivenher/articles/2536.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows Mobile开发环境搭建指南 一</title><link>http://www.cppblog.com/ivenher/articles/2535.html</link><dc:creator>爱饭盒</dc:creator><author>爱饭盒</author><pubDate>Tue, 10 Jan 2006 05:44:00 GMT</pubDate><guid>http://www.cppblog.com/ivenher/articles/2535.html</guid><wfw:comment>http://www.cppblog.com/ivenher/comments/2535.html</wfw:comment><comments>http://www.cppblog.com/ivenher/articles/2535.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ivenher/comments/commentRss/2535.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ivenher/services/trackbacks/2535.html</trackback:ping><description><![CDATA[本文描述了如何搭建典型的<A href="http://dev.21tx.com/os/windows/" target=_blank><FONT color=#3366cc>Windows</FONT></A> Mobile开发环境。介绍了相应的IDE、SDK及辅助开发工具的安装及常用配置，并对<A href="http://dev.21tx.com/mobile/wince/" target=_blank><FONT color=#3366cc>Windows Mobile</FONT></A>下一代开发环境的发展前景做出展望。本文适合初次接触Windows Mobile开发的开发人员。 <BR><BR>　　<B>Windows Mobile开发简介</B><BR><BR>　　Windows Mobile是微软公司<A href="http://dev.21tx.com/os/" target=_blank><FONT color=#3366cc>操作系统</FONT></A>产品线上重要的一环。与Windows 9x/NT/XP/2003相比，Windows Mobile作为完整产品线出现在公众面前的时间非常短，但它的发展却异常迅速，而在这一发展过程中，开发人员提供了绝对关键的推动力。现在，越来越多的开发人员（特别是<A href="http://dev.21tx.com/dotnet/" target=_blank><FONT color=#3366cc>.net</FONT></A>开发人员）希望能尽快进入Windows Mobile的开发领域，而他们所面临的首要问题，除了熟悉Windows Mobile平台特性之外，便是如何搭建适合的开发环境。因此，本文就将从如何搭建一个Windows Mobile开发环境入手，对Windows Mobile平台的开发特性进行概要描述，以期帮助开发人员迅速进入Windows Mobile开发领域。<BR><BR>　　在展开本文的内容之前需要说明的一点是，Windows Mobile平台开发主要包含以下两方面内容：<BR><BR>　　 平台级开发<BR><BR>　　 应用级开发<BR><BR>　　因为Windows Mobile平台构建于微软的Windows CE系列操作系统之上（当前正式商用版本为Windows CE .NET 4.21），而Windows CE操作系统具有非常良好的模块化特性，因此开发人员，特别是<A href="http://mobile.21tx.com/" target=_blank><FONT color=#3366cc>手机</FONT></A>设备厂商，可以通过微软提供的Platform Builder及eMbedded Visual <A href="http://dev.21tx.com/language/c/" target=_blank><FONT color=#3366cc>C++</FONT></A>（以下简称为e<A href="http://dev.21tx.com/language/vc/" target=_blank><FONT color=#3366cc>VC</FONT></A>）非常方便地定制自己所需的操作系统。这对应的是上面所说的平台级开发。<BR><BR>　　然而，绝大多数的开发人员并不需要去构建一个全新的、个性化的系统，他们只需要关心如何构建能够运行在Windows Mobile设备上的应用程序。为此，微软按主要智能设备自身<A href="http://diy.21tx.com/" target=_blank><FONT color=#3366cc>硬件</FONT></A>设备特性的不同以及用户体验的差异，定制出了Windows CE .NET 4.x系列操作系统的两个主要分支，分别安装在不同的Windows Mobile硬件设备中，从而也就构成了我们通常所说的Pocket PC和Smartphone。以下内容中的Windows Mobile开发，除特指之外，均表示Pocket PC/Smartphone开发。<BR><BR>　　本文中提供的大量开发工具，除单独标出的以外，均可在http://msdn.microsoft.com/mobility/downloads/default.<A href="http://dev.21tx.com/web/asp/" target=_blank><FONT color=#3366cc>ASP</FONT></A>x<A href="http://dl.21tx.com/" target=_blank><FONT color=#3366cc>下载</FONT></A>。<BR><BR>　　<B>迅速搭建开发环境<BR></B><BR>　　为了进行Windows Mobile开发，我们需要搭建相应的开发环境。所幸的是，这一环境搭建起来非常简单。<BR><BR>　　安装Visual Studio .NET 2003<BR><BR>　　为了降低Windows Mobile的开发难度，提高开发人员的开发效率，微软把.NET <A href="http://dev.21tx.com/dotnet/framework/" target=_blank><FONT color=#3366cc>Framework</FONT></A>移植到了Windows Mobile设备上，针对Windows Mobile设备及Windows CE .NET操作系统设计了.NET Compact Framework（以下简称.NET CF）。而Visual Studio .NET 2003正是开发.NET CF应用程序的最佳IDE。在Visual Studio .NET 2003的安装中默认集成了.NET CF 1.0，同时提供了Pocket PC 2002的开发模板，可以直接用来开发Pocket PC 2002应用程序。<BR><BR>　　您也可以选择Visual Studio 2005作为开发工具，目前最高版本为Beta 1 Refresh。在Visual Studio 2005中，默认提供了Pocket PC/Smartphone 2003 SE（第二版）的开发模板，同时将Pocket PC 2003 SE开发使用.NET CF版本升级到2.0 (beta)。<BR><BR>　　安装eVC (可选)<BR><BR>　　以上环境已经完全可以基于.NET CF开发Windows Mobile应用程序。但如果您想使用C/C++语言来进行native开发，或者想在Windows Mobile设备上开发COM组件及应用，那么可以选择eVC作为开发工具。目前eVC的最高版本为4.0 + SP4，请确保安装了最新的补丁包。<BR><BR>　　也许您会问：既然已经有了Visual Studio .NET环境，为什么还要使用eVC作为开发工具呢？这主要是因为，当前的.NET CF功能相对而言还很不完整，有很多Windows CE .NET操作系统的核心功能没有被封装入.NET CF，如：加密/解密、网络底层通讯、COM互操作、RAPI等等。为了完成上述操作，我们或者使用平台调用(P/Invoke)以托管方式开发，或者使用eVC直接针对系统底层进行native开发。对于COM互操作，目前.NET CF还不提供COM互操作(Interop)机制，只能使用eVC进行C/C++ COM开发。好消息是，在.NET CF 2.0中将提供功能强大的COM互操作特性支持，同时也将在Visual C++ 2005环境中同时提供managed及native开发功能，这样所有的开发工作将完全整合在Visual Studio 2005同一环境中。<BR><BR>　　安装Pocket PC/Smartphone 2003 SDK<BR><BR>　　为了开发Pocket PC 2003或Smartphone 2003应用程序，您还需要安装Pocket PC 2003 SDK或Smartphone 2003 SDK。值得注意的是，这两款SDK中所包含的模拟器均为英语环境，如果您想使用简体中文环境的模拟器，请去微软网站上单独下载。 如果您使用Visual Studio 2005开发Windows Mobile应用程序，则不需要单独安装相应的SDK，因为SDK已经被默认集成至了Visual Studio 2005环境中。<BR><BR>　　<A href="http://dev.21tx.com/database/mssql/" target=_blank><FONT color=#3366cc>SQL Server</FONT></A> CE (可选)<BR><BR>　　这是Pocket PC上推荐使用的嵌入式<A href="http://dev.21tx.com/database/" target=_blank><FONT color=#3366cc>数据库</FONT></A>产品，它与SQL Server桌面版之间可以实现良好的数据同步及互操作，目前正式版的最新版本为2.0。在SQL Server 2005 Beta 2测试版中，包含有SQL Server CE 2.0的升级版本SQL Server 2005 Mobile Edition——不过该版本目前只支持Pocket PC 2003系统。预计SQL Server Mobile Edition在下一个版本中才能提供对Smartphone的支持。<BR><BR><img src ="http://www.cppblog.com/ivenher/aggbug/2535.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ivenher/" target="_blank">爱饭盒</a> 2006-01-10 13:44 <a href="http://www.cppblog.com/ivenher/articles/2535.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>