using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;namespace Admin
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class Send : System.Web.UI.Page
{
   
    protected System.Web.UI.WebControls.Label lblMessage;
    protected System.Web.UI.WebControls.Label lblMessage2;
    protected System.Web.UI.WebControls.TextBox txtName;
    protected System.Web.UI.WebControls.TextBox txtContent;
    protected System.Web.UI.WebControls.Button btnOk;
    protected System.Web.UI.WebControls.Button btnCancel;            private SqlConnection conn ;
    private SqlCommand comm;
            private SqlDataAdapter dpt;
    private DataSet DSPageData;
    private string strSQL;
    private string strConn;
   
            protected void btnOk_Click(object serder,EventArgs e)
    {
        string strContent = txtContent.Text.Trim();
string strName = txtName.Text.Trim();
if (strContent.Length > 70)
{
    Response.Write("<script>alert('发送内容长度不能多于70字!');</script>");
    return;
}
        strConn=System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
conn = new SqlConnection(strConn);
        conn.Open();

comm = new SqlCommand("sp_9120006_SendMsg",conn);
comm.CommandType = CommandType.StoredProcedure;
comm.Parameters.Add("@name",SqlDbType.VarChar,20);
comm.Parameters.Add("@message",SqlDbType.VarChar,140);
comm.Parameters["@name"].Value =strName;
                comm.Parameters["@message"].Value =strContent;
                try
{
  comm.ExecuteNonQuery();
  Response.Write("<script>alert('短信群发已成功完成!');</script>");
 }
 catch(Exception E)
 {
   Response.Write("<script>alert(E.Message);</script>");
 }
        conn.Close();
                
    }
    protected void btnCancel_Click(object serder,EventArgs e)
   {
       txtName.Text = "";
       txtContent.Text = "";
   }
private void Page_Load(object sender, System.EventArgs e)
{
                  // 在此处放置用户代码以初始化  
  if(Convert.ToString(Session["uid"])==string.Empty)
     Response.Redirect("default.aspx");
  if(!Page.IsPostBack)
  {
   }
}
              
}
}

解决方案 »

  1.   

    你有对应SP的通道接口吗?没有的话你发不出去。其实SP就是提供一个URL,比如http://xxx.xxx/getSMS.aspx?parm1=PhoneNumer&parm2=Msg...你用程序给他GET或者Post请求,把相关的信息给它就行了
      

  2.   

    呵呵。有点郁闷。
    网上的大哥,大姐,能否发一个整个源码给偶,
    偶的Email:[email protected]
    谢了。
      

  3.   

    发给你也没有用,SP一般都会验证IP的,你发不出去
      

  4.   

    你没网关有啥用,程序再好也不行。
    去申请吧,不过money得大大的。
      

  5.   

    发给你也没有用,SP一般都会验证IP的,你发不出去
      

  6.   

    同问,我已经有移动的短信网关了,asp怎么实现跟他消息互通?