对于短信发送到手机,我使用下面的代码,但是它不起作用请任何人帮我 [英] For SMS send to mobile i used below code, but its not working pls any one help me

查看:64
本文介绍了对于短信发送到手机,我使用下面的代码,但是它不起作用请任何人帮我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void Button1_Click(object sender, EventArgs e)
    {
  
        UriBuilder urlBuilder = new UriBuilder();
        urlBuilder.Host = "127.0.0.1";
        urlBuilder.Port = 8800;

         
        string PhoneNumber = "09638136263";
        string message = "Just a simple text";

        urlBuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "&Text=" + message);

        HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlBuilder.ToString(), true));
        HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse());

       Response.Write(httpResponse.StatusCode.ToString());
        Response.Write("sms send successfully"); 

}

推荐答案

文章:
通过Web服务使用.NET发送SMS [使用ASP.NET脚本发送SMS短信 [使用vb.net发送短信 [如何使用C#通过asp.net发送短信? [^ ]

Nutshell::ASP.NET不具有任何内置的API支持来发送SMS.您需要使用第三方解决方案或使用Internet上的某些内容.上面的文章和讨论将为您提供帮助.
Articles:
Sending SMS using .NET through Web service[^]
Sending SMS text messages using ASP.NET scripts[^]

Discussion links:
sending sms using vb.net[^]
how to send sms through asp.net with c#? [^]

Nutshell: ASP.NET does NOT have any inbuilt API support to send out an SMS. You need to go for a third party solution or use something that is found on the Internet. Articles and discussions above should help you out.


这篇关于对于短信发送到手机,我使用下面的代码,但是它不起作用请任何人帮我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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