I am here with 56 SMS interface for example!
First need to 56 SMS online to register an account, the code needs to use 4 parameters: Enterprise ID, user name, password, the platform used
In the inside to fill the money with the following code can send text messages!
public void Send (string orderids, String Mobile, String productName)
{
Tel: is the mobile number you want to send
Msg: What to send
Send SMS
String cid = "1345";//Enterprise number ID
String username = "test15";//user name
String userpwd = "test15333";//Password
String mssage = "Order submitted successfully!";
String _sms = "10690";//Platform
String msg = "Your order has been submitted successfully!" + "Order Number: (" + orderids + ") Product Name:" + ProductName + "" Company Name "";
msg = Httputility.urlencode (msg, System.Text.Encoding.GetEncoding ("GBK"));//Because the site is UTF-8 encoding, to do a bit of transcoding, otherwise it will be garbled, Call the webs without transcoding
string Tel = mobile;
String url = "Http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=" + cid + "&username=" + username + "&userpwd= "+ userpwd +" &handtel= "+ Tel +" &sendcontent= "+ msg +" &sendtime=&smsnumber= "+ _sms +" ";
WebRequest wrequest = webrequest.create (URL);
WebResponse wresponse = Wrequest.getresponse ();
Stream stream = Wresponse.getresponsestream ();
StreamReader reader = new StreamReader (stream, System.Text.Encoding.Default);
String r = Reader. ReadToEnd ();
Wresponse.close ();
ScriptUtil.Instance.Alert (Mssage);
}
Extended reading:
Guide: we only provide ASP. 56 SMS Interface core code, for different sites, systems, can make corresponding changes. This interface can only send one mobile phone number at a time, such as need to send multiple, can loop, or call httpinterfacemore.aspx and WebService file interface, this source code only applies to 56 SMS interface, the other is not the development of the company interface, there are problems, We don't do technical support.
We only provide the core code, for the wrong platform, can make corresponding changes.
This interface can only send one phone number at a time, such as need to send multiple times, can loop, or call httpinterfacemore.aspx and WebService file interface
If the content is garbled, please encode it, such as:
String message = "People's Republic of China";
Message = Httputility.urlencode (message, System.Text.Encoding.GetEncoding ("GB2312"));
You need to reference the name of the namespace:
Using System.Text;
Using System.IO;
Using System.Net;
The code is as follows:
public string Httpinterface ()
{
String url= "http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid= Enterprise id&username= username &userpwd= Password & Handtel= Mobile phone Number
&sendcontent= Content limited to 70 characters &sendtime= time &smsnumber= the platform "
WebRequest wrequest = webrequest.create (URL);
WebResponse wresponse = Wrequest.getresponse ();
Stream stream = Wresponse.getresponsestream ();
StreamReader reader = new StreamReader (stream, System.Text.Encoding.Default);
String r = Reader. ReadToEnd ();
Wresponse.close ();
}
For more details, please read the website: http://www.56dxw.com/Interface/150.html
This article is from the "Program Ape" blog, please be sure to keep this source http://haihuiwei.blog.51cto.com/4789207/1586627
C # SMS Interface code implementation (texting)