日期:2014-05-19  浏览次数:20720 次

HTTP调用
利用HTTP发短信的问题,例如以下是联通的文档演示例子
http://www.unispms.com/subscription/serviceredir.aspx?SPNumber=9999&AccessTime=2004-02-28   10:10:10&EncodeStr=KIQWNWEQREQWK921343KJASDFASD
在IE地址栏中输入以上地址,敲回车就可以把短信发到指定号码上

现在如何在C#程序里达到以上功能?

------解决方案--------------------
HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create( "http://www.contoso.com ");
// Turn off connection keep-alives.
HttpWReq.KeepAlive = false;

HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();

------解决方案--------------------
WebClient webClient=new WebClient();
byte[] myDataBuffer = webClient.DownloadData(strURl);