Short-Interest billing platform: Http://sms.webchinese.cn/User/?action=key
Code:
Using System;
Using System.Collections.Generic;
Using System.ComponentModel;
Using System.Data;
Using System.Drawing;
Using System.IO;
Using System.Linq;
Using System.Net;
Using System.Text;
Using System.Threading.Tasks;
Using System.Windows.Forms;
Namespace Duanxin
{
public partial class Form1:form
{
private string url = "http://utf8.api.smschinese.cn/?";
private string struid = "uid=";
private String strkey = "&KEY=CB7BFDB566347FB1CBCE";
private string strmob = "&smsmob=";
private string strcontent = "&smstext=";
Public Form1 ()
{
InitializeComponent ();
}
private void Button1_Click (object sender, EventArgs e)
{
if (textBox1.Text.ToString (). Trim ()! = "" && textBox2.Text.ToString (). Trim ()! = "" && richTextBox1.Text.ToString ()! = null) {
URL = url + struid + textbox1.text + strkey + strmob + TextBox2.Text + strcontent + richtextbox1.text;
String Result = Gethtmlfromurl (URL);
MessageBox.Show (Result);
}
}
public string gethtmlfromurl (string url)
{
string strret = null;
if (url = = NULL | | | URL. Trim (). ToString () = = "")
{
return strret;
}
String targeturl = URL. Trim (). ToString ();
Try
{
HttpWebRequest hr = (HttpWebRequest) webrequest.create (TargetUrl);
hr. useragent = "mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) ";
hr. Method = "GET";
hr. Timeout = 30 * 60 * 1000;
WebResponse hs = hr. GetResponse ();
Stream sr = HS. GetResponseStream ();
StreamReader ser = new StreamReader (SR, Encoding.default);
strret = ser. ReadToEnd ();
}
catch (Exception)
{
strret = null;
}
return strret;
}
}
}
Interface:
C # Send SMS