使用Windows应用程序发送短信

时间:2013-07-05 11:03:17

标签: c# asp.net

我想创建一个win表单,使用该表单我可以将短信发送到所需的手机号码。我尝试了不同的发送方式,但没有成功,这是我的努力,但没有奏效。 (这些都是冒充的随机数字)
第一次尝试:

using SmsClient;
SendSms oSendSMS = new SendSms();
MessageBox.Show(oSendSMS.send("1234567890", "1111", "Hello", "1234567890"));

第二次尝试:

HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=way2sms");

            HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
            System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
            string responseString = respStreamReader.ReadToEnd();
            respStreamReader.Close();
            myResp.Close();

第三次尝试:

using SMSClassLibrary;
    string status = "";
                CookieContainer cookie = Login.Connect("1234567890", "1111", out status);
                string[] siteParameters = Login.GetSiteParameters(cookie);
                MessageBox.Show(SendSMS.Send_Processing("1234567890", "jkdfhjnhsd", cookie, siteParameters));

任何人都可以帮助我们继续这些努力吗?

2 个答案:

答案 0 :(得分:0)

请参阅the API's site,其声称“Way2SMS”提供商(您似乎使用的,根据您的网址以&provider=way2sms结尾)不再适用于非专用用户。

答案 1 :(得分:-1)

您无法通过互联网直接发送短信,您需要使用与移动网络互连的提供商,并使用他们为您提供的API。你的第二个例子看起来就像那些线。

他们是大量的提供商,只搜索批量短信或短信API。

相关问题