In order to verify the identity of the operator, the interface usually has the ability to obtain the authentication code. and click to get the verification code will be sent to the phone number you enter a message to verify.
Recently, the company has also included this function in my task, so let me explain next.
------------------
To use this function is to spend money, someone to provide you with the account and password and then call the interface implementation.
Plainly this piece of knowledge is the introduction of the call SMS interface.
Less nonsense, directly on the code:
String posurl = "Http://139.129.107.247/sms/xml/send?username=" + username + "&password=" + UserPassword + "&mobi Le= "+ telphone +" &message= "+ httputility.urlencode (msgcontent, System.Text.Encoding.GetEncoding (" Utf-8 "));
WebRequest request = WebRequest.Create (@posurl);
WebResponse response = Request. GetResponse ();
Stream stream = Response. GetResponseStream ();
Encoding encode = Encoding.UTF8;
StreamReader reader = new StreamReader (stream, encode);
string result = Reader. ReadToEnd (); >0 success, SMS batch number 1971
Long issuccess = Convert.toint64 (result),//issuccess>0 send success
if (issuccess > 0)// Return 1 proof send successful return 0 proof send failed!
{Context
. Response.Write ("1");
}
else
{context
. Response.Write ("0");
}
View Code
Introduction of several parameters:
String UserName = "";//user
String userpassword = "";//user password
String msgcontent = "Send SMS test content";
--------------------------------------------------
By calling the above code, you can send a text message ~
Enterprise SMS landing site: http://sms.ydqxt.com