动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 移动短信技术
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ 移动短信技术 ]的信息



本月文章推荐
.CMPP ACTIVE TEST.
.为Nokia S60编写移动游戏之二.
.基于CMPP2及东软API短信平台的开.
.CMPP CONNECT CODE SAMPLE.
.用C#设计在局域网发送短信的程序.
.Windows CE.Net下矩阵键盘开发设.
.用脚本发送带有SMS的文本消息.
.BREW、JAVA、.NET三大平台之比较 .
.用C#完成的QuerySMStatusA(华为A.
.MIDI文件结构分析及生成方法.
.基于Nokia S60的游戏开发之四.
.Windows CE下驱动程序开发基础.
.基于Nokia S60的游戏开发之五.
.SMS基本概念和移动通信系统介绍.
.免费实用!3步搞定电邮手机推送!.
.motorola铃声算法,是Java的!.
.基于CMPP3.0的企业短信网关API设.
.WAP网关服务器应用介绍.
.基于Nokia S60的游戏开发之一.
.EMS图片格式转换(Java)程序.

编写SMS程序入门

发表日期:2003-6-11 |


Introduction To Application Programming With SMS
编写SMS程序入门

Microsoft Corporation
October 2002
Applies to:
    Pocket PC 2002 Phone Edition
    Microsoft® eMbedded Visual Tools
版权声明:本文的著作权属英文原文作者,允许非商业性转载请注明原文出处、翻译者并保持该文的完整性。谢绝商业性转载,如有需要请自行和原文作者及翻译者联系。
Summary: Learn how to Send SMS messages from your eMbedded Visual Basic applications. Take advantage of Pocket PC 2002 Phone Edition's robust support for SMS (Short Message Service) when you build your applications.
概要:学习如何使用你的eMbedded Visual Basic应用程序发送SMS消息。当你创建程序时,需要得到Pocket PC 2002 Phone Edition 对SMS(短消息服务)的充分支持。
Download the introapp.exe from the MSDN Code Center.
Contents

SMS and Pocket PC Phone Edition
SMS-Enabled Applications
Sending SMS Sample
Code Walkthrough
Conclusion
SMS and Pocket PC Phone Edition
SMS和Pocket PC Phone版本

Short Message Service is a standard for sending short alpha-numeric messages (max 160 characters) between mobile phones in Global System for Mobile Communications networks (GSM). It works much like paging, but with text, and most phones today have support for SMS.
Short Message Service是通过Mobile Communications networks (GSM)的全球系统在移动电话间发送short alpha-numeric messages(最多160字符)的标准。它像寻呼机一样工作,只是用于文本格式,现在的大多数电话都支持SMS。
A key aspect of SMS is that messages are sent through the mobile network operator's network instantly, without the need to manually connect to an Internet Service Provider—SMS messages are instantly delivered while e-mails need to be retrieved from a mail server by the receiver. Also, if the receiver is not online—if the phone is turned off—the SMS message is stored at the operator and forwarded when the phone is turned back on.
SMS的一个关键特点是,通过无线网络服务器的网络立即发送,不需要手动连接到Internet Service Provider—SMS消息是立即发送,而e-mails需要通过接收器从邮件服务器上接收。同样,如果接收器没有在线—如果电话关闭—SMS消息被储存在服务器中,当电话打开时再转发。
On Pocket PC 2002 Phone Edition devices, you can manage SMS messages much in the same way that you manage e-mail messages. The SMS Messaging component is integrated with the standard Inbox application, allowing you to send and receive messages in the same way you send and receive e-mails. You can even forward and reply to e-mails as SMS messages, and vice versa.
在Pocket PC 2002 的电话版设备上,你可以和管理e-mail消息一样来管理SMS消息。SMS消息组件是一个完整的标准收件箱应用程序,允许你像收发电子邮件一样,收发SMS消息。你也可以转发和回复SMS消息,像电子邮件一样。
SMS-Enabled Applications
SMS-Enabled 应用程序

Many business scenarios involve notifications of some sort, and SMS is a great way to implement notifications for a variety of business events. It could be a salesman that notifies a service engineer of a customer in need of service, a service engineer notifying an executive of an important business event at the customer, or an executive informing all staff related to the customer about new customer handling routines.
许多商业机构忙碌于对一些通知的选择,SMS是一条极好的实现适应变化多样的商业事件消息通知的途径。它可以让一个销售人员向售后服务工程师转达消费者的需求,一个服务工程师向经理发送一个重要的商务事件,或者一个经理向全体员工发送新的消费者操作办法。
Another interesting use of SMS is to enable mobile commerce (m-commerce), as SMS is often used for handling payment transactions. To get you started, we will show you how to send SMS messages from your Pocket PC 2002 Phone Edition device in the following example.
SMS另一个有趣的应用是能够进行移动商务(m-commerce),SMS经常被用来办理付款事物。我们将通过下面的例子,演示如何从你的Pocket PC 2002 Phone Edition设备中发送SMS消息。
Sending SMS Sample
发送SMS示例

A simple form using Microsoft® eMbedded Visual Basic®:
这个例子使用Microsoft® eMbedded Visual Basic® 编写:

Figure 1. SMS Sample application
In this form, you can enter an international mobile phone number and a text message. When you hit the Send button, the message is sent—as simple as that!
在这个窗体中,你可以输入一个世界范围内的移动电话号码和一条文本消息。当你点击发送按忸,这条消息就被发送出去了—就这么简单。
Code Walkthrough
代码示例

Let's look at the core of the code for sending SMS messages. First of all, you need to declare a number of Microsoft Windows® APIs:
让我们来看发送SMS消息代码的核心部分。首先,你需要声明一系列的Microsoft Windows® APIs:
·                     One for opening the SMS Messaging component
·                     One for sending SMS messages
·                     And one for closing the SMS Messaging component:
·                     一个函数是打开SMS消息组件
·                     一个函数是发送SMS消息
·                     另一个函数是关闭SMS消息组件
·                           Public Declare Function SmsOpen Lib "SMS" (ByVal ptsMessageProtocol
·                             As String, ByVal dwMessageModes As Long, ByRef psmshHandle As
·                             Long, ByRef phMessageAvailableEvent As Long) As Long
·                           
·                           Public Declare Function SmsSendMessage Lib "SMS" (ByVal smshHandle
·                             As Long, ByVal psmsaSMSCAddress As Long, ByVal
·                             psmsaDestinationAddress As String, ByVal pstValidityPeriod As
·                             Long, ByVal pbData As String, ByVal dwDataSize As Long, ByVal
·                             pbProviderSpecificData As String, ByVal dwProviderSpecificDataSize
·                             As Long, ByVal smsdeDataEncoding As Long, ByVal dwOptions As Long,
·                             ByRef psmsmidMessageID As Long) As Long
·                           
·                           Public Declare Function SmsClose Lib "SMS" (ByVal smshHandle As
·                             Long) As Long

You also need some API constants declared for the different APIs:
你也需要为这些API声明一些API常量:
Public Const SMS_MSGTYPE_TEXT = "Microsoft Text SMS Protocol"
Public Const SMS_MODE_SEND = 2            ' Open in send mode
Public Const SMSDE_GSM = 1                ' Use standard GSM
  encoding
Public Const SMSAT_INTERNATIONAL = 1      ' International number
  format
Public Const PS_MESSAGE_OPTION_NONE = 0   ' No message options
Public Const PS_MESSAGE_CLASS0 = 0        ' Send immediately
Public Const PSRO_NONE = 0                ' No replacements
Public Const SMS_OPTION_DELIVERY_NONE = 0 ' No delivery options

The following is the complete code to send an SMS message:
下面是发送一条SMS消息的完整代码:
Public Sub SendSMS(ByVal Number As String, ByVal Message As String)
 
  Dim SMSHandle As Long
  Dim SMSEvent As Long
  Dim SMSAddress As String
  Dim SMSProvider As String
 
  ' Open SMS Messaging Component
  Call SmsOpen(SMS_MSGTYPE_TEXT, SMS_MODE_SEND, SMSHandle, SMSEvent)
 
  ' Set Address structure (UDT as string)
  SMSAddress = LongToBytes(SMSAT_INTERNATIONAL) & Number
 
  ' Set Provider structure (UDT as string)
  SMSProvider = LongToBytes(PS_MESSAGE_OPTION_NONE) & _
                LongToBytes(PS_MESSAGE_CLASS0) & _
                LongToBytes(PSRO_NONE)
 
  ' Send message
  If 0 = SmsSendMessage(SMSHandle, 0, SMSAddress, 0, Message, _
         LenB(Message), SMSProvider, 12, SMSDE_GSM, _
         SMS_OPTION_DELIVERY_NONE, 0) Then
    MsgBox "Message sent!", vbInformation, App.Title
  Else
    MsgBox "Could not send message!", vbCritical, App.Title
  End If
 
  ' Close SMS Messaging Component
  Call SmsClose(SMSHandle)
 
End Sub

First, the SMS Messaging component is opened (SmsOpen) and its handle is stored (SMSHandle). This handle is needed to call other SMS APIs.
首先,SMS消息组件要被打开(SmsOpen),并且它的句柄被储存(SMSHandle)。调用其他的SMS API需要使用这个句柄。
A number of structures or UDTs (User Defined Types) need to be prepared for thecall to SmsSendMessage. Since eMbedded Visual Basic lacks support for UDTs, simple strings are used to emulate a structure.
SmsSendMessage调用的结构的成员和UDTs(用户定义类型)需要被初始化,因为eMbedded Visual Basic不支持UDTs,简单的字符串被用来模仿一个结构。
The first is a structure containing the address of the SMS message. The address structure contains an indicator of what kind of number is supplied (in this case an international number) and the number itself.
The next structure contains various options regarding the service provider. The first part of the structure indicates that no special options are selected, and the second part indicates that the message should be sent immediately.
结构中包含的第一个是SMS消息的地址。结构的第一部分指出没有特定的选项被选择,第二部分指出消息将被立刻发送。
The last part states that no replacement should be made.
最后一部分指出没有复位(replacement)存在。
In the call to send the message (SmsSendMessage), the prepared structures are supplied, the message text and a number of options. Finally, the handle is closed (SmsClose).
在发送消息的调用中(SmsSendMessage),准备好的结构,消息文本和号码的选项将被提供。最后,这个句柄被关闭(SmsClose)。
For a complete example, see this article's sample code. Also, you can read more about this technique in Antonio Paneiro's article, UDTs (User Defined Types) with VBCE.
完整的示例请看文章的示例代码。同样,你可以在Antonio Paneiro的文章中得到更多关于这项技术的知识,UDTs (User Defined Types) with VBCE.
Conclusion
结论

SMS is great for small and instant text notifications. And with the support in Pocket PC 2002 Phone Edition, you will be able to make your applications "SMS aware." With the sample code from this example, you have most of what you need to get going. If you accept that the mobile world, in terms of communication mechanisms and protocols, is more about "both/and" rather than "or/else," you pragmatically can use each option when suitable.SMS对于短小的直接的文本通知来说是非常好的。在Pocket PC 2002 Phone Edition的支持下,你可以创建你的应用程序"SMS aware"。通过和示例相同的代码,你可以得到更多你需要的。如果你接受移动世界,根据通讯机制和协议,"both/and"优于"or/else",你可以根据情况使用合适的选项。


上一篇:CMPP2.0协议升级 人气:16376
下一篇:用C#编写发手机中文短信息 人气:16842
浏览全部SMS的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-7-9 顶级域名交易系统 v3.0 完整版
2008-7-9 ACTCMS网站管理系统 v2.0 Build
2008-7-9 Roclog v3.1.4 build 20080706
2008-7-9 乐彼网上开店系统(56770 Eshop)
2008-7-9 深度学习alexa排名提升专家 v1.0
2008-7-9 BBSXP 2008 Build 8.0.5 正式版
2008-7-9 一句话快速信息发布系统 修正完美
2008-7-9 ACTCMS网站管理系统 v2.0 Build
2008-7-9 乐涛涛留言本 08版
2008-7-5 AgileMessenger即时通讯工具 v1.
2008-7-5 GoodCalculator2.0版固件计算器
2008-7-5 RepoName源地址搜索工具 v1.21b
2008-7-5 AgileMessenger即时通讯工具 v1.
2008-7-5 TouchCopy多媒体管理软件 v3.13完
2008-7-5 VideosTone视频铃声 v1.1汉化破解
2008-7-5 TouchPad触摸板 v4.44破解版
2008-7-5 VideosTone破解补丁 v1.0
2008-7-5 Feeds GoogleReader客户端 v0.4.3


  发表评论
姓 名: 验证码:
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報