Remote Control of Computer with WAP mobile phone

Source: Internet
Author: User

I have seen and discussed Remote Computer Control in newspapers and magazines.ArticleMost of the software used in these articles is based onNetMeetingAndPCAnywhereOf course, these software has its advantages, but they rely entirely on computers, and the network speed between the server and the client must be fast enough. It would be much more difficult to sit on a bus to control the computer at home, hold a notebook and a GPRS phone. Is there a more convenient way to remotely control the computer? I just applied for a mobile phone WAP service a few days ago. Can I use the mobile phone's WAP browser to control the computer? I implemented this control through WAP web pages, ASP and VB.Program.

I. Setup of WAP Server

To make WAP a medium for communication between mobile phones and computers, you must first create a WAP Server. This server must have an independent IP address. We recommend that you have an independent domain name to avoid the trouble of changing the IP address. I am using the dynamic domain name resolution service of peanut shells.

The server software I use is from Microsoft.Iis6.0, The operating system isMicrosoft Windows Server 2003.
Create a new MIME type on the IIS platform. Select the properties of the WAP site, and then select the "HTTP header" tab. In the "MIME type" section, click "MIME type" and create the following information:

extension MIME type
WML text/vnd. WAP. WML
wmlc application/vnd. WAP. wmlc
wbmp image/vnd. WAP. wbmp
wmlsc application/vnd. WAP. wmlscriptc
WMLS text/vnd. WAP. WMLScript
WSC application/vnd. WAP/wmlscriptc

The following types are displayed:

Now, you can add your website content to the site folder.

Ii. WML language

WML (Wireless Markup LanguageIs the markup language used for WAP. The suffix of the WML page file is *. WML, just like the *. html Suffix of HTML. The XML specification defines the specification of a standard XML file. Any WML file that violates this rule will go wrong. WML files are usually interpreted using an XML interpreter.

1. Basic Structure of the XML Program

A complete WML language tutorial requires dozens of pages. These tutorials can be found on the Internet. Here we will only give you a rough introduction to some necessary knowledge. We start with a simple page.

<? XML version = "1.0"?>
<! Doctype WML public "-// wapforum // dtd wml 1.1 // en"
Http://www.wapforum.com/DTD/wml_1.1.xml>
<WML>
<Card Title = "fenghao">
<P> I'm fenghao </P>
</Card>
</WML>

This program displays "I'm fenghao" on the phone ".

The WML language is very strict, even if it is different, it will lead to errors. All WML programs must declare the XML file type at the beginning of the file, including the XML version, WML document type, and usage specification. The declaration form is as follows:

<? XML version = "1.0"?>
<! Doctype WML public "-// wapforum // dtd wml 1.1 // en"
Http://www.wapforum.com/DTD/wml_1.1.xml>

WML documents are composed of "card" and "card group (deck)". A deck is a collection of one or more cards. After the client sends a request, WML sends the deck to the client's browser from the network. This allows the user to browse all the cards contained in the deck without downloading each card from the Internet, the first card in the program is the default visible card.

<XML> tag: This label is used to include and define a deck of WML. It has an optional XML: lang attribute to define the language of the document. For example, <wml xml: lang = "ZH"> indicates that the document language is Chinese.

<Card> label: WML uses <card> and </card> for inclusion and definition. <Card> it can contain multiple optional attributes at the same time,
For example:
Card id = "name" Title = "label" newcontext = "false" ordered = "true" onenterforwand = "url" pmemterbackward = "url" ontimer = "url">.

2. WAP web page Construction

The following program is placed on the home page of the website. Its name is index. WML. The mobile WAP browser will access a webpage and ask the user to enter and perform the operation.CodeAnd send the code to resquest. asp.

<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype WML public "-// wapforum // dtd wml 1.1 // en"
Http://www.wapforum.org/DTD/wml_1.1.xml>


element here. -->










code:





implement!




Go is mainly used to define the URL address that the browser needs to navigate. Statement <go href = "request. in ASP "method =" Post ">, the href attribute is used to specify the target URL address; the method attribute is used to specify whether a form is submitted in get or post mode. postfield applies for data exchange with ASP through URL. In <postfield name = "code" value = "$ Sid"/>, the name attribute is used to specify the name of the transfer domain, and the value attribute is used to define the transfer value. Both attributes are mandatory.

I would like to give you a suggestion that there are many WML browsers on the Internet, such as winwap. These browsers are sometimes not strict, and some web pages can be viewed on winwap, but on mobile phones, it is often because of some minor errors. Therefore, when debugging, pay attention to the cooperation between the mobile phone and the WML Browser to avoid failure in executing the code on the mobile phone.

Iii. Server

Request. asp is a server program that responds to mobile phone requests. It obtains the operation code entered by the user and writes the code into a text file.

<% @ Language = VBScript %>
<% Response. contenttype = "text/vnd. WAP. WML"
Code = request. Form ("Code ")
Filename = "E: \ code.txt"
Set FS = Createobject ("scripting. FileSystemObject ")
Set Ss = FS. createtextfile (filename, true)
SS. Write (CODE)
SS. Close %> <? XML version = "1.0"?>
<! Doctype WML public "-// wapforum // dtd wml 1.1 //" http://www.wapforum.org/DTD/wml_1.1.xml ">
<WML>
<Card id = "Main">
<P>
Complete !!!
</P>
</Card>
</WML>

Program readE: \ code.txtSave variableLstr, And then0Write a text file (rule 0 does not represent any operation, so that the program does not perform the same operation repeatedly ). Final judgmentLstrContent to determine what operations to perform. Here, we use the API FunctionExitwindowsexForced shutdown (in different operating systems, this API function has different effects, not as goodWin9xIn the environment, you can perform shutdown, restart, and other operations.Windows2003 ServerIn the environment, you can only log out.ExitwindowsexThe second parameter sets other constants such as ewx_reboot ).

Of course, remote control computers do not only need to be shut down and restarted, but more functions are still waiting for development!

Now everything is ready. Turn on your server, take out your cell phone, and play with a computer remotely controlled by a mobile phone!

Debugging environment:

Operating System: Windows 2003 cold ice Server

Development Environment: Visual Basic 6.0

Mobile: Philips fisio 620 openwave mobile browser 5.0.1.11 WAP Edition

Operator: China Mobile (Dynamic zone) China Netcom LAN broadband

Domain name resolution: peanut shell 2.0

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.