通过互联网将短信从应用程序发送到手机

问题描述:

我为学校/学院开发了一个应用程序.我集成了模块短信.

如何通过互联网通过批量SMS帐户向手机发送SMS并保存批量帐户配置?

请帮忙........


在此先感谢

I develope a Application for School / College. I integrate a module SMS.

How I send SMS via internet through Bulk SMS Account to Cell Phone and save Bulk Account Confugration ?

please help........


thanks in advance

第一个您需要批量发送短信
2)激活发件人ID并将信用额添加到您的帐户中
3)从您的SMS API提供程序获取HTTP API的详细信息.
4)提供YOur API帐户的用户名和密码.


这是我的从我的SMS API CLASS发送SMS的代码
First YOu Need Bulk SMS Accound
2) Activate the Sender ID and Add Credits into your account
3) Get the Details of HTTP API from your SMS API provider.
4)Provide the UserName and Password of YOur API Account.


Here is My code for sending SMS from My SMS API CLASS
using System.Net;
using System.Text;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace YOurProject.Classes
{
    class SENDSMS
    {
        private WebProxy objProxy1 = null;
        public string SendSMS(string User, string password, string Mobile_Number, string Message)//send parameters as UserName Password mobileNUmb and Message from your application
        {
            string stringpost = null;
            stringpost = "User=" + User + "&passwd=" + password + "&mobilenumber=" + Mobile_Number + "&message=" + Message;
            HttpWebRequest objWebRequest = null;
            HttpWebResponse objWebResponse = null;
            StreamWriter objStreamWriter = null;
            StreamReader objStreamReader = null;
            try
            {
                string stringResult = null;
                objWebRequest = (HttpWebRequest)WebRequest.Create("http://sms.equilux.co.in/WebserviceSMS.aspx");//this is your SMS API provider''s URL
                objWebRequest.Method = "POST";
                if ((objProxy1 != null))
                {
                    objWebRequest.Proxy = objProxy1;
                }
                 objWebRequest.ContentType = "application/x-www-form-urlencoded";
                objStreamWriter = new StreamWriter(objWebRequest.GetRequestStream());
                objStreamWriter.Write(stringpost);
                objStreamWriter.Flush();
                objStreamWriter.Close();
                objWebResponse = (HttpWebResponse)objWebRequest.GetResponse();
                objStreamReader = new StreamReader(objWebResponse.GetResponseStream());
                stringResult = objStreamReader.ReadToEnd();
                objStreamReader.Close();
                return stringResult;
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            finally
            {
                if ((objStreamWriter != null))
                {
                    objStreamWriter.Close();
                }
                if ((objStreamReader != null))
                {
                    objStreamReader.Close();
                }
                objWebRequest = null;
                objWebResponse = null;
                objProxy1 = null;
            }
        }
 }
}