Get started within a day. Net + WAP project (Reprinted)

2010-07-02  来源:本站原创  分类:Mobile  人气:199 

Get started within a day. Net + WAP project (Reprinted)

Interest on the WAP is open from freshman year on the semester just talk QQ mobile wap package and play it when the bubble; later, they play a bit wap online games. Oh, really amazing ah.

Come in contact this afternoon, WAP technology, starting from the basic agreement WAP, to the basic principles of WAP, and WAP development history, current status, Oops, big head and all to see. Then at last, to the question, and probably learned about WML and WMLScript, and installed EasyPad WAPtor and WinWAP play, hey, found that pretty good! Fun and easy.

Although hardly a meal beginning at noon, but still enthusiastic. Dark, and found a website, http://www.wapkf.com, called "wap Development Network", found that the wap one item can also use my familiar. Net platform to develop! Haha, cool too! I read one breath finished "wap asp.net development tutorial" in the region all the articles and tried many things yourself.

There are two understandings:

(1) use. Net platform wap project is quite simple, you can even do not know what is WML! And. Net platform can generate a different browser to return data, that is, the same project, using cell phones and use IE to see can see! This is the other development platforms can not be done! (Personal guess: at least with the asp and php do not do wap project, such as http://wap.qq.com or http://wap.wappp.com/, with mobile phones and IE access to the two different program.) such http://wap.sswww.cn/ this site, it certainly is. net to do it! . Net for wap project development has become so easy, my heart began a little Sabre-rattling.

(2). Net's wap procedures and general asp.net program biggest difference is that in more than one page can be set within a Form - it should be designed to save network transmission. This is a very fun features, cool dead! I even think, will a simple wap site to use a aspx file will be able to make out ... ...

The more science is really the more dynamic, and did not expect. Net platform wap so easy to get started. Then I began to search some of the Internet use. Net development wap source code. I found, online-based. Net's wap procedure that is rarely. Is this technology just started? And to asp or php wap written procedures on considerably more, even the forum, blog, Mall of such large programs are doing out, and very refined and improved. . Net platform seems to be a very serious cold.

Finally found the sets. Net's wap procedures (estimated regarded baidu can search to get things done, of a total of 78 such program source code it), some of which was compiled the. Dll, and a bit depressed. Fortunately, however, and Emperor it pays off, I found a bed of roses in the program source code - a message of the program, and really was I guess! This program really is only one aspx page!

Fortunately I have enough solid. Net basis, although the program is written with VS2003 + VB (now popular VS2005 + C #), but also a small number of grammatical errors, but I quickly adjusted the a ~ ~ haha, excited, then start a file to a file, read the code line by line.

The main database operations written in a process called "Bikewap" inside the class, and index.asp.vb which will be the instantiation. Read and delete data in the process of nothing to say, are common. Have a function more creative, that is, replace the message in the illegal characters, to avoid sql injection attacks may encounter other potential hazards. Summarized as follows:

'Replace special characters

Public Function ReplaceSpecficChar (ByVal StrSource As String)
StrSource = Replace (StrSource, "<", "<")
StrSource = Replace (StrSource, ">", ">")
StrSource = Replace (StrSource, "'", "'")
StrSource = Replace (StrSource, """", "" ")
StrSource = Replace (StrSource, "&", "&")
Return StrSource
End Function

Then to the wonderful part of it! Since the program a total of only one aspx page, so authors use. Net wap page features on this page, use the three different Form, the message of the entire operation, including the cover, and very flexible switch very subtle and capable and vigorous!

As follows

<% @ Register TagPrefix = "mobile" Namespace = "System.Web.UI.MobileControls" Assembly = "System.Web.Mobile"%>

<% @ Page Language = "vb" AutoEventWireup = "false" Inherits = "BicyleWap.MobileWebForm1" trace = "False" CodeFile = "index.aspx.vb" CodeFileBaseClass = "System.Web.UI.MobileControls.MobilePage"%>

<html>

<HEAD>

<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"/>

<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"/>

</ HEAD>

<body> <mobile:form title=" Message list " Paginate="True" runat="server">

<mobile:Image runat="server" ImageUrl="images\bikelogo.png"> </ mobile: Image>

<mobile:List runat="server" Decoration="Bulleted" ItemsPerPage="10" onItemCommand="OnItemSelection"> </ mobile: List>

<mobile:Link runat="server" NavigateUrl="#frmNewMessage"> I want to shout </ mobile: Link>

<mobile:Link runat="server" NavigateUrl="#frmMain"> Back Home </ mobile: Link> </ mobile: form> <mobile: form title = "View Message" Paginate = "True" runat = "server" >

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Link runat="server" NavigateUrl="#frmNewMessage"> I want to shout </ mobile: Link>

<mobile:Link runat="server" NavigateUrl="#frmMain"> return to a higher level </ mobile: Link>

</ Mobile: form> <mobile:form title=" Fill out the message " runat="server">

<mobile:Label runat="server" Wrapping="Wrap"> message title </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<mobile:RequiredFieldValidator runat="server" ControlToValidate="TxtMessageTitle" ErrorMessage=" Please fill in the message header "> </ mobile: RequiredFieldValidator>

<mobile:Label runat="server" Wrapping="Wrap"> Content </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<mobile:RequiredFieldValidator runat="server" ControlToValidate="TxtMessageContent" ErrorMessage=" Please fill in the message content "> </ mobile: RequiredFieldValidator>

<mobile:Label runat="server" Wrapping="Wrap"> your nickname </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<mobile:RequiredFieldValidator runat="server" ControlToValidate="TxtPersonName" ErrorMessage=" Please leave your nickname "> </ mobile: RequiredFieldValidator>

<mobile:Label runat="server" Wrapping="Wrap"> your mail </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<Mobile: RegularExpressionValidator runat = "server" ControlToValidate = "TxtEmail" ErrorMessage = "Please enter the correct Email address"

ValidationExpression = "\ w +([-+.] \ w +) * @ \ w +([-.] \ w +) * \. \ W +([-.] \ w +)*"></ mobile: RegularExpressionValidator>

<mobile:Command runat="server" Format="Link"> to submit a message </ mobile: Command>

<mobile:Link runat="server" NavigateUrl="#frmMain"> view the message </ mobile: Link>

</ Mobile: form> <mobile:form title=" Message success " runat="server">

<mobile:Image runat="server" ImageUrl="images\bikelogo.png"> </ mobile: Image>

<mobile:Label runat="server" Wrapping="Wrap"> Congratulations, message success! </ Mobile: Label>

<mobile:Link runat="server" NavigateUrl="#frmMain"> view the message </ mobile: Link>

<mobile:Link runat="server" NavigateUrl="#frmNewMessage"> to a message </ mobile: Link>

</ Mobile: form>

</ Body>

</ Html>

Note that this format NavigateUrl: "# frmMain", which is a flexible way to jump Form and Form in index.aspx.vb activities which set the page attributes, such as ActiveForm = FrmSuccess. Very similar to the general. Aspx page inside the pannel, but the senior and more convenient than the pannel, and Oh ~

In addition, index.aspx.vb which, the authors define several operations on the page control functions, and ordinary. Net project, there's really nothing.

So few lines of code, it completed a message this can not only browse with IE directly, but can still browse the wap on the phone program.

Finally attach the program to run in winWAP screenshot (note that IE is not Oh, winWAP see the cell phone to see the effect):

Summary: In the several hours online reading the information, learned so many things, there is such a feeling: did not expect. Net and wap protocol came out so long that the two projects together by people who do so little, is it because it was too simple? Oh I think. Net + wap can we develop a future direction.

First, the development of wap project a new and very fun.

Second, the use of. Net is also relatively new to do wap project more easily.

Third, this and we usually learn. Net does not conflict, do not spend a lot of time, you can successfully restructured. (Actually, to tell the truth, I only know the basic syntax WML, simply look not very understand the standard WML file. Use. Net do wap, really do not need to learn much of WML.)

Fourth, we can consider the future do. Net project, the way to make a wap version, is also a bright spot.

The purpose of writing this article is to hope and share my. Net + wap interest to yourself my friend to go along with me to learn the route, and hope that my learning experience in some of the ideas we are able to the help. Have little talent and less learning with words do not convey, and did not check the do not know if I have typos, written entirely temporary excitement, but also hope that the masters exhibitions.

<% @ Register TagPrefix = "mobile" Namespace = "System.Web.UI.MobileControls" Assembly = "System.Web.Mobile"%>

<% @ Page Language = "vb" AutoEventWireup = "false" Inherits = "BicyleWap.MobileWebForm1" trace = "False" CodeFile = "index.aspx.vb" CodeFileBaseClass = "System.Web.UI.MobileControls.MobilePage"%>

<html>

<HEAD>

<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"/>

<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"/>

</ HEAD>

<body> <mobile:form title=" Message list " Paginate="True" runat="server">

<mobile:Image runat="server" ImageUrl="images\bikelogo.png"> </ mobile: Image>

<mobile:List runat="server" Decoration="Bulleted" ItemsPerPage="10" onItemCommand="OnItemSelection"> </ mobile: List>

<mobile:Link runat="server" NavigateUrl="#frmNewMessage"> I want to shout </ mobile: Link>

<mobile:Link runat="server" NavigateUrl="#frmMain"> Back Home </ mobile: Link> </ mobile: form> <mobile: form title = "View Message" Paginate = "True" runat = "server" >

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Label runat="server" Wrapping="Wrap"> </ mobile: Label>

<mobile:Link runat="server" NavigateUrl="#frmNewMessage"> I want to shout </ mobile: Link>

<mobile:Link runat="server" NavigateUrl="#frmMain"> return to a higher level </ mobile: Link>

</ Mobile: form> <mobile:form title=" Fill out the message " runat="server">

<mobile:Label runat="server" Wrapping="Wrap"> message title </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<mobile:RequiredFieldValidator runat="server" ControlToValidate="TxtMessageTitle" ErrorMessage=" Please fill in the message header "> </ mobile: RequiredFieldValidator>

<mobile:Label runat="server" Wrapping="Wrap"> Content </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<mobile:RequiredFieldValidator runat="server" ControlToValidate="TxtMessageContent" ErrorMessage=" Please fill in the message content "> </ mobile: RequiredFieldValidator>

<mobile:Label runat="server" Wrapping="Wrap"> your nickname </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<mobile:RequiredFieldValidator runat="server" ControlToValidate="TxtPersonName" ErrorMessage=" Please leave your nickname "> </ mobile: RequiredFieldValidator>

<mobile:Label runat="server" Wrapping="Wrap"> your mail </ mobile: Label>

<mobile:TextBox runat="server"> </ mobile: TextBox>

<Mobile: RegularExpressionValidator runat = "server" ControlToValidate = "TxtEmail" ErrorMessage = "Please enter the correct Email address"

ValidationExpression = "\ w +([-+.] \ w +) * @ \ w +([-.] \ w +) * \. \ W +([-.] \ w +)*"></ mobile: RegularExpressionValidator>

<mobile:Command runat="server" Format="Link"> to submit a message </ mobile: Command>

<mobile:Link runat="server" NavigateUrl="#frmMain"> view the message </ mobile: Link>

</ Mobile: form> <mobile:form title=" Message success " runat="server">

<mobile:Image runat="server" ImageUrl="images\bikelogo.png"> </ mobile: Image>

<mobile:Label runat="server" Wrapping="Wrap"> Congratulations, message success! </ Mobile: Label>

<mobile:Link runat="server" NavigateUrl="#frmMain"> view the message </ mobile: Link>

<mobile:Link runat="server" NavigateUrl="#frmNewMessage"> to a message </ mobile: Link>

</ Mobile: form>

</ Body>

</ Html>

Note that this format NavigateUrl: "# frmMain", which is a flexible way to jump Form and Form in index.aspx.vb activities which set the page attributes, such as ActiveForm = FrmSuccess. Very similar to the general. Aspx page inside the pannel, but the senior and more convenient than the pannel, and Oh ~

In addition, index.aspx.vb which, the authors define several operations on the page control functions, and ordinary. Net project, there's really nothing.

So few lines of code, it completed a message this can not only browse with IE directly, but can still browse the wap on the phone program.

Finally attach the program to run in winWAP screenshot (note that IE is not Oh, winWAP see the cell phone to see the effect):

相关文章
  • Get started within a day. Net + WAP project (Reprinted) 2010-07-02

    Get started within a day. Net + WAP project (Reprinted) Interest on the WAP is open from freshman year on the semester just talk QQ mobile wap package and play it when the bubble; later, they play a bit wap online games. Oh, really amazing ah. Come i

  • jsp development wap Note (Reprinted) 2010-07-05

    The following is reproduced from http://why100000.com/_articles/show_a_article.asp?tab=tabJava&autoid=570 jsp development wap notes JSP in the Chinese solution: China Mobile by adding the following after a few words, the page can write in Chinese, do

  • Manage projects using Maven ----- create Struts2, Spring, Hibernate project (Reprinted order) 2011-05-24

    Maven should have heard it! A build tool! Compared with Ant, it is more coarse-grained! No need to write build.xml file, to operate the project compile, run, packing! As long as you create a Maven project, the compiler, just mvn compile! Maven will a

  • Maven multi-environment configuration of actual combat 2010-02-02

    Origin: Currently developing a wap project, mainly the development, testing and eventual deployment of on-line in several stages, each stage of the configuration (database, log) has a different setting. Previously been dominated by the development en

  • Debug log of the slf4j + logback 2010-11-29

    After logging system on-line system, there will inevitably be problems, this time the debug log is a good developer lifesaver. Selection of the logging system which we choose to slf4j + logback for development. The new work of the slf4j log4j commons

  • Maven real multi-environment configuration 2010-02-02

    Origin: Currently developing a wap project, mainly developing, testing and eventual deployment of on-line in several stages, each stage of the configuration (database, log) has a different setting. Had previously been dominated by the development env

  • [Change] Maven 2.0: Compile. Test. Deploy. Run 2010-03-30

    Abstract: Maven1.0 has experienced a few years, and as a substitute for Ant has been widely received by developers, but it did not very much to the developer's build.xml files from Ant freed. Maven1.0 slow and clumsy, and difficult to use up as much

  • HIbernatre 3.3: org.slf4j.impl.StaticLoggerBinder exception 2011-01-03

    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: See http://www.slf4j.org/codes.html # StaticLoggerBinder for further details. Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLogge

  • (Turn) Apache open source project profiles on all the JAVA 2010-03-29

    Close contact with Jakarta-Common-BeanUtils this Dongdong are more, so pairs of Apache Jakarta Project generated interest, on their official website under the terms of the useful things that a lot of sense, blinking, and no Chinese website, but also

  • J2ME platform, WAP web analytic 2010-03-29

    Done more than two years J2ME platform for mobile application development, from newly recruited line a rookie, and now very much at home on the new project, the process that is bitter, but also happy. Each developer must have a profound experience. E

  • Kjava Forest Toolbox source code (jbuilder project) 2010-04-22

    j2me source code, a mobile phone with convenient toolbox jbuilder development projects. jbuilder 2005 + wtk2.5 To share about. Study together. Project can only be used for learning, restricted to commercial use. Source code analysis: MobileMIDlet sta

  • Framework of the project and open source Java project 2010-06-13

    Spring Framework Java open source JEE framework] [ Spring is a J2EE development solves many common problems in a powerful framework. Spring provides a consistent method of managing business objects and to encourage the implantation of the interface p

  • WAP 2.0 design principles 2010-06-30

    Done a year wap developed to collect relevant information dry in the sun A design site preparation work before Both in the design of a mobile device and also for PC-oriented services, the first need for mobile device user interface design. To extend

  • WAP application development environment built 2010-07-27

    J2ME Development Network has recently opened up a Java technology and WAP development project, the development project will be mainly about the WAP and Java technologies in some combination. The article is no longer open up new sections, if the users

  • Introduction to WAP development and enhancement of user input processing element 2010-07-30

    Part III: WML main grammar - the user input processing element 3.5 User input processing element Through WAP mobile phone keypad, users can show the card to the browser, enter data or operational information. WML provides a treatment for this specifi

  • erlang open source project 2010-10-08

    1, ejabberd is a Jabber / XMPP protocol instant messaging server, licensed under the GPLv2 license (free and open source), written in Erlang / OTP. Among other features, ejabberd is cross-platform, fault tolerance, clusterable and modular. Developmen

  • wap, net, gsm, gprs, edge, cdma2000, wcdma, td-scdma what 2010-11-10

    wap, net, gsm, gprs, edge, cdma2000, wcdma, td-scdma What is it? WAP is a wireless terminal used (such as digital mobile phones) for information services of the main criteria. WAP standard is based on Internet standards (HTML, XML and TCP / IP). It i

  • Project management experience 2009-02-28

    Say, each project manager has its own different experiences, different experiences. And different projects, different regions, and different stakeholders, policies are not the same. Overall, I would be regarded as its own below a rough summary. I hop

  • The company first entered the company I would like to Optimize SQL project 2009-02-28

    I was a time not long into the company of people, but also a person to be graduated, but immediately entered the project team, involved in the development. The project is to make a China Telecom Operation System, is a big system. My so-called develop

  • Ask! Hibernate project to do when to do what the strategy is necessary to optimize the system performance, that is, how to improve the retrieval performance strategy? 2009-03-03

    Ask! Hibernate project to do when to do what the strategy is necessary to optimize the system performance, that is, how to improve the retrieval performance strategy? I had not thought about it, only know about the cache settings, please show Big Bro