如何从 Windows Phone 8.1 应用程序中发送 SMS 消息 [英] How to send a SMS message from within an Windows Phone 8.1 app

查看:36
本文介绍了如何从 Windows Phone 8.1 应用程序中发送 SMS 消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个 Windows Phone 8.1 应用程序,通过 SMS 消息将设备的位置发送给电话联系人列表中的联系人.如何发送短信?

I would like to create a Windows Phone 8.1 app that sends the location of the device to a contact in the contact list of the phone via a SMS message. How do I send a SMS message?

推荐答案

在 Windows Phone 8.1 中,您可以使用 ChatMessageManager 发送短信:

In Windows Phone 8.1, You can send sms using ChatMessageManager:

Windows.ApplicationModel.Chat.ChatMessage msg 
         = new Windows.ApplicationModel.Chat.ChatMessage();
msg.Body = "This is body of demo message.";
msg.Recipients.Add("10086");
msg.Recipients.Add("10010");
await Windows.ApplicationModel.Chat.ChatMessageManager
         .ShowComposeSmsMessageAsync(msg);

其中有 2 个重要参数:BodyRecipients.

There are 2 important params in it: Body and Recipients.

正文是您要发送的内容.

Body is the content you will send.

收件人是将收到短信的联系人列表.

Recipients is the contact list who will receive the sms.

这篇关于如何从 Windows Phone 8.1 应用程序中发送 SMS 消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆