给一个网址传递参数,并接收返回的参数。
public string SendMsg(string user,string password,string phone,string text)
{
try
{
//if (!Regex.IsMatch(phone, @"^(13|15)\d{9}$"))
// return "手机号码格式错误!";
string url = "http://www.xunsai.net:8000/";
string param = "user=" + user+ "&password=" + password + "&phonenumber=" + phone + "&text=" + text + "&charset=gb2312";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.AllowAutoRedirect = true;
request.ContentType = "text/html;charset=GB2312;";
NetworkCredential nc = new NetworkCredential(user, password);
request.Credentials = nc;
byte[] dat