从asp.net网站发送短信 [英] Sending SMS from asp.net website
问题描述
有没有办法从asp.net发送短信?是的,我知道Web服务,但不知道如何调用该服务从我的应用程序。
Is there a way to send SMS from asp.net ? Yes, i know about web services, but dont know how to call that service from my app.
推荐答案
Web服务是做到这一点的最好办法。我使用Twilio的网站上,这是令人难以置信的容易得到建立和工作。可扩展性是没有问题的,你会超过弥补不必花时间开发建设自己的解决方案的成本。
Web services are the best way to do it. I use Twilio on a site, and it was incredibly easy to get set up and working. Scalability is no issue, and you will more than make up for the cost in not having to spend developer hours building your own solution.
Twilio: http://www.twilio.com/
适用于.NET Twilio库/安装
Twilio libraries available for .NET: https://www.twilio.com/docs/csharp/install
从twilio-CSHARP项目,这里是如何发送短信的例子(我把这个从twilio-CSHARP,只需重新发布它显示它是多么容易)
From the twilio-csharp project, here is the example of how to send an SMS (I took this from twilio-csharp. Just reposting it to show how easy it is)
static void Main(string[] args)
{
TwilioRestClient client;
// ACCOUNT_SID and ACCOUNT_TOKEN are from your Twilio account
client = new TwilioRestClient(ACCOUNT_SID, ACCOUNT_TOKEN);
var result = client.SendMessage(CALLER_ID, "PHONE NUMBER TO SEND TO", "The answer is 42");
if (result.RestException != null) {
Debug.Writeline(result.RestException.Message);
}
}
这篇关于从asp.net网站发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!