如何使用C#在手机上发送免费短信 [英] How to send free SMS on mobile using C#

查看:79
本文介绍了如何使用C#在手机上发送免费短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在ASP.NET MVC中开发一个应用程序,使用Twilio API在Mobile上发送短信。众所周知,这是一个通过Twilio发送短信的付费服务。我想开发一个网络应用程序,在移动设备上发送免费短信,如www.way2sms.com有没有办法在不使用API​​的情况下使用ASP.Net发送免费短信Twilio。



谢谢

Hi,

I am developing a application in ASP.NET MVC to send SMS on Mobiles using Twilio API. As you all know it is a paid service to send SMS through Twilio.I want to develop a web application to send free SMS on Mobile like www.way2sms.com Is there any way to Send Free SMS using ASP.Net without using API Like Twilio.

Thanks

推荐答案

是的,有一个解决方案。



您需要和服务器(计算机)上的GSM调制解调器一起使用SIM卡(可以为任何公司的免费短信计划支付租金[sprint,at& t ...])。有了你的手机上的计划,你可以免费无限制短信,只需支付租金,比支付每条短信更好。



GSM MODEMS:

USB(我用这样的一个测试)

3G WCDMA GSM WIFI 7.2 Mbps HSDPA USB Dongle

中兴MF190 3 G GSM 7.2 Mbps USB移动宽带调制解调器



另有多张SIMS卡:

MódemsUSBGSM 8 Puertos批量短信



另一种调制解调器:

M2MmódemM2MRS232MódemQ24plus



APP(c#):

SMSapplication.zip



首先连接到COM端口,应用程序显示连接状态,在第二个选项卡发送短信中输入手机号码和信息,然后按发送。



代码(按钮):

Yes there is a solution.

You need and GSM modem on you server(computer) with a SIM card (could pay a rent for a plan with free sms in any company [sprint, at&t...]). With the plan like on your cellphone you have free unlimited SMS, only pay a rent, better than pay for every single SMS.

GSM MODEMS:
USB (I made test with one like this)
3G WCDMA GSM WIFI 7.2 Mbps HSDPA USB Dongle
ZTE MF190 3 G GSM 7.2 Mbps USB Mobile Broadband Modem

Another with multiple SIMS cards:
Módems USB GSM 8 Puertos bulk sms

And another kind of modem:
M2M módem M2M RS232 Módem Q24plus

The APP (c#):
SMSapplication.zip

First connect to the COM port, the application show the status of the connection, in the second tab "Send SMS" put the cellphone number and the message, then press send.

The code(Button):
private void btnSendSMS_Click(object sender, EventArgs e)
       {

           //.............................................. Send SMS ....................................................
           try
           {

               if (objclsSMS.sendMsg(this.port, this.txtSIM.Text, this.txtMessage.Text))
               {
                   //MessageBox.Show("Message has sent successfully");
                   this.statusBar1.Text = "Message has sent successfully";
               }
               else
               {
                   //MessageBox.Show("Failed to send message");
                   this.statusBar1.Text = "Failed to send message";
               }

           }
           catch (Exception ex)
           {
               ErrorLog(ex.Message);
           }
       }





寄送课程:



Send Class:

public bool sendMsg(SerialPort port, string PhoneNo, string Message)
        {
            bool isSend = false;

            try
            {
                
                string recievedData = ExecCommand(port,"AT", 300, "No phone connected");
                recievedData = ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.");
                String command = "AT+CMGS=\"" + PhoneNo + "\"";
                recievedData = ExecCommand(port,command, 300, "Failed to accept phoneNo");         
                command = Message + char.ConvertFromUtf32(26) + "\r";
                recievedData = ExecCommand(port,command, 3000, "Failed to send message"); //3 seconds
                if (recievedData.EndsWith("\r\nOK\r\n"))
                {
                    isSend = true;
                }
                else if (recievedData.Contains("ERROR"))
                {
                    isSend = false;
                }
                return isSend;
            }
            catch (Exception ex)
            {
                throw ex; 
            }
          
        }   







我没做这个应用程序,我在互联网上找到...我做了测试,它的工作。



要用gsm调制解调器构建你的网络,你必须要考虑:

- 连接调制解调器的物理服务器(可能是你的电脑)

- 支付短信(SIM卡)的租金计划

- 支付静电IP,或noIP,din DNS,无论如何,让你的服务器在线



GSM调制解调器重新接收AT命令,这就是c#应用程序所做的,发送AT命令到调制解调器。

gsm modem at commands



我希望它有所帮助




I didn't make this app, I found on internet... I made test and It's worked.

To build your web with a gsm modem you have to considerate:
- Have a physical server with the modem connected (could be your computer)
- Pay a rent plan for SMS (Sim cards)
- Pay a static IP, or noIP, din DNS, whatever, to put you server online

The GSM modem recive AT Commands, thats what the c# application does, send the AT commands to the modem.
gsm modem at commands

I hope it helps


谷歌是你的朋友:使用ASP.Net发送免费短信 [ ^ ]



将来,请尝试在自己最基础的研究,不要浪费你的时间或我们的时间。
Google is your friend here: Send Free SMS using ASP.Net[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.


这篇关于如何使用C#在手机上发送免费短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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