C#实现给手机发送短信

public static void SendSMS(string FaSongUser, string ToUserList, string ContentStr)
    {
        //针对不同的短信猫接口,请修改此方法       
        string MobTelList = "";
        //根据用户名列表获取手机号码 admin,test,zwl,test123
        DataSet MyDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select JiaTingDianHua from ERPUser where UserName in(‘" + ToUserList.Replace(",", "‘,‘") + "‘)");
        for (int i = 0; i < MyDT.Tables[0].Rows.Count; i++)
        {
            if (MobTelList == "")
            {
                MobTelList = MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString();
            }
            else
            {
                if (MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString().Trim().Length > 0)
                {
                    MobTelList = MobTelList + "," + MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString();
                }
            }
        }
        //发送短信
        MobCallClient.SMS MySms = new MobCallClient.SMS();
        string StateStr=MySms.SendSMS(ConfigurationManager.AppSettings["enCode"], ConfigurationManager.AppSettings["enPassword"], ConfigurationManager.AppSettings["userName"], MobTelList, ContentStr);
    }


    //发送外部短信,直接是手机号码列表
    public static void SendSMS2(string FaSongUser, string ToUserList, string ContentStr)
    {
        string MobTelList = ToUserList;       
        //发送短信
        MobCallClient.SMS MySms = new MobCallClient.SMS();
        string StateStr = MySms.SendSMS(ConfigurationManager.AppSettings["enCode"], ConfigurationManager.AppSettings["enPassword"], ConfigurationManager.AppSettings["userName"], MobTelList, ContentStr);
    }
    public static void GetSMS(string GetUserName)
    {
        //针对不同的短信猫接口,请修改此方法
    }

C#实现给手机发送短信,布布扣,bubuko.com

C#实现给手机发送短信

上一篇:《 Java并发编程从入门到精通》Thread安全与不安全


下一篇:Android中实现不同文字颜色和图文混排的Span总结