C#短信发送问题 [英] Issue with C# SMS sending

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

问题描述

你好朋友!



我有一个紧急问题。



我是初学者,我试图用C#发送短信。我发现了这个 C#SMS 解决方案,但我无法使其正常运行。我发送邮件后,短信网关中没有显示该消息。我一定错过了一些设置,但我无法弄清楚是什么。



我真的可以使用一些帮助。



提前致谢。

Hello friends!

I have an urgent question.

I am a beginner and I was trying to send SMS in C#. I found this C# SMS solution, however I could not make it work. The message was not showing in the SMS Gateway after I sent it. I must have missed some settings but I cannot figure out what.

I could really use some help.

Thanks in advance.

推荐答案

试试这段代码:

Try this code :
public void send(string message, string no)
{

HttpWebRequest myReq =
// (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password +
//"&msg=" + message + "&phone=" + no + "&provider=way2sms");
(HttpWebRequest)WebRequest.Create("puturlink = "+"UrUsername"+ "&password=" + "UrPassword" + "&sender=" +"UrSenderID"+ "&to=" +no+ "&message=" + message+ "&reqid=1&format={json|text}&route_id=route+id&callback=Any+Callback+URL&unique=1&sendondate=" +"10-10-2014T05:17:52"+"");
HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
}

//Button Click code
protected void btn_send_Click(object sender, EventArgs e)
{

send(txt_message.Text, txt_mobile.Text);

ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('sms sent successfully...');", true);

}


看看这篇文章



< a href =http://www.codeproject.com/Tips/783904/Sending-an-SMS-using-NET>发送短信使用NET


这篇关于C#短信发送问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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