亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

編寫SMS程序入門

2019-11-18 20:02:07
字體:
來源:轉載
供稿:網友

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",你可以根據情況使用合適的選項。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
亚洲精品久久久久久久久久久久| 日韩电影免费在线观看中文字幕| 欧美日韩国产成人| 欧美一区二区三区精品电影| 韩国三级日本三级少妇99| 久久国产视频网站| 欧美国产第一页| 欧美激情二区三区| 欧美激情手机在线视频| 日本久久久久久久久| 国产日韩精品在线观看| 韩国精品久久久999| 日韩欧美999| 国产乱人伦真实精品视频| 久久精品中文字幕一区| 亚洲xxxx做受欧美| 爽爽爽爽爽爽爽成人免费观看| 一区二区在线免费视频| 亚洲精品视频久久| 日韩亚洲一区二区| 久久五月情影视| 国产精品96久久久久久又黄又硬| 91av免费观看91av精品在线| 精品国产欧美一区二区五十路| 97香蕉久久超级碰碰高清版| 久久精品国产精品| 69国产精品成人在线播放| 亚洲国产精品成人一区二区| 国产精品久久久久9999| 久久久精品在线| 亚洲人成电影网| 在线观看不卡av| 久久视频在线观看免费| 久久高清视频免费| 久久夜色精品亚洲噜噜国产mv| 欧美一区二区三区免费观看| 欧美中文在线字幕| 亚洲精品国产精品国自产在线| 国产亚洲a∨片在线观看| 黑人巨大精品欧美一区二区三区| 久久国产精品免费视频| 国产精品成人久久久久| yellow中文字幕久久| 亚洲精品福利在线观看| 青青久久av北条麻妃海外网| 91日本在线视频| 欧美日韩国产色视频| 45www国产精品网站| www.日本久久久久com.| 91精品国产乱码久久久久久久久| 55夜色66夜色国产精品视频| 国产成人福利网站| 国产精自产拍久久久久久蜜| 亚洲福利视频网| 欧美在线国产精品| 亚洲精品网站在线播放gif| 精品国产福利视频| 成人有码在线视频| 欧美日韩视频在线| 亚洲成年网站在线观看| 精品免费在线视频| 欧美黑人性猛交| 色一情一乱一区二区| 国产精品一区二区av影院萌芽| 国产成人免费av电影| 欧美高清激情视频| 欧美孕妇与黑人孕交| 亚洲色图17p| 日韩免费黄色av| 日韩天堂在线视频| 色综合五月天导航| 不卡av在线播放| 中文字幕欧美日韩va免费视频| 最近2019中文字幕一页二页| 久久久久久伊人| 人人爽久久涩噜噜噜网站| 欧美日韩国产一中文字不卡| 91精品国产91久久久久久最新| 亚洲欧洲中文天堂| 在线日韩第一页| 日韩精品免费在线视频观看| 国产精品视频自拍| 欧美贵妇videos办公室| 国产精品久久久久久久久久新婚| 国模极品一区二区三区| 亚洲欧美制服第一页| 久久综合亚洲社区| 91在线观看免费| 日韩有码在线视频| 亚洲国产欧美日韩精品| 久久免费精品日本久久中文字幕| 国产97色在线|日韩| 亚洲精美色品网站| 国产偷国产偷亚洲清高网站| 久久成年人免费电影| 国产精品jvid在线观看蜜臀| 日韩久久精品成人| 欧美一区二粉嫩精品国产一线天| 午夜精品久久久久久99热软件| 秋霞成人午夜鲁丝一区二区三区| 视频直播国产精品| 亚洲毛片在线免费观看| 少妇高潮久久77777| 欧美黑人一级爽快片淫片高清| 久久久免费精品| 精品国偷自产在线| 亚洲欧美日韩一区在线| 成人亚洲激情网| 国产精品69av| 久久久噜久噜久久综合| 伦伦影院午夜日韩欧美限制| 欧美猛交ⅹxxx乱大交视频| 92福利视频午夜1000合集在线观看| 日韩网站免费观看| 亚洲成人在线视频播放| 国产激情久久久| 色爱av美腿丝袜综合粉嫩av| 国产亚洲欧美视频| 日韩精品在线观看一区| 国产一区视频在线| 亚洲乱亚洲乱妇无码| 亚洲欧美日韩另类| 久久91超碰青草是什么| 555www成人网| 久久国产一区二区三区| 富二代精品短视频| 欧美激情免费看| 久久久免费精品视频| 久久精品免费电影| 91理论片午午论夜理片久久| 国产精品第一页在线| 久久深夜福利免费观看| 亚洲毛茸茸少妇高潮呻吟| 这里只有视频精品| 午夜精品三级视频福利| 2020欧美日韩在线视频| 国产精品丝袜久久久久久高清| 成人黄色在线免费| 97人洗澡人人免费公开视频碰碰碰| 国产www精品| 国产一区二区三区在线观看网站| 欧美美女15p| 粉嫩av一区二区三区免费野| 亚洲人成网站免费播放| 国产午夜精品久久久| 久久久欧美一区二区| 久久久免费高清电视剧观看| 日韩中文字幕第一页| 国产精品伦子伦免费视频| 久久精品91久久香蕉加勒比| 性色av一区二区三区红粉影视| 国产精品国内视频| 欧美日韩国产成人高清视频| 欧美国产日韩视频| 成人久久18免费网站图片| 欧美黑人xxx| 久久精品在线播放| 欧美日韩在线看| 在线激情影院一区| 精品国产乱码久久久久久婷婷| 国产精品欧美风情| 欧美国产视频一区二区| 国产精品视频男人的天堂| 亚洲乱码一区二区|