我已将我的Twilio库更新为最新版,现在SendMessage不再解析.
client.SendMessage("YOUR_TWILIO_NUMBER","YOUR_NUMBER","来自Twilio的Ahoy!");
如何使用当前的C#Twilio图书馆发送文本?
Twilio开发者传道者在这里.
听起来你已经从Twilio C#库的第4版更新到第5版了.这是一个包含重大更改的更新,此处提供了完整的升级文档.
要发送消息,您需要更新以使用新消息MessageResource.这是一个例子:
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
using System.Collections.Generic;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/console
const string accountSid = "your_account_sid";
const string authToken = "your_auth_token";
TwilioClient.Init(accountSid, authToken);
var to = new PhoneNumber("+15017250604");
var message = MessageResource.Create(
to,
from: new PhoneNumber("+15558675309"),
body: "This is the ship that made the Kessel Run in fourteen parsecs?");
Console.WriteLine(message.Sid);
}
}
Run Code Online (Sandbox Code Playgroud)
如果有帮助,请告诉我.
| 归档时间: |
|
| 查看次数: |
2324 次 |
| 最近记录: |