返回首页

您好,
我想为特定的时间间隔发送短信从我的申请短信订阅uers。

是它可以使用ASP.NET Web应用程序,或者我可以使用Windows服务?

回答

评论会员:游客 时间:2012/02/06
是的,你可以做短信GetWay的帮助
RaviRanjankr
评论会员:游客 时间:2012/02/06
是你需要一个网关请参阅此链接imgsrc=]
Anuja帕瓦尔多尔
评论会员:游客 时间:2012/02/06
codeprespanclass="code-keyword"public/spanspanclass="code-keyword"void/spanSendMessage() { spanclass="code-keyword"try/span { spanclass="code-keyword"string/spanMsg=spanclass="code-string""/spanspanclass="code-string"yourmessgae"/span; Msg=Msg.Substring(spanclass="code-digit"1/span,spanclass="code-digit"160/span); spanclass="code-comment"///spanspanclass="code-comment"thisisyoursmsgatewayapiurl/spanspanclass="code-keyword"string/spanUrl=spanclass="code-string""/spanspanclass="code-string"http://www.bulksms.ambikacomputers.com/messageapi.asp?username="/spanyouruseridspanclass="code-string""/spanspanclass="code-string";password="/spanyourpasswordspanclass="code-string"'/spanspanclass="code-string"&sender="yoursenderid";mobile="+txt_mobile.Text.Trim()+"&message="+Msg;  System.Net.HttpWebRequestmyReq=(System.Net.HttpWebRequest)System.Net.WebRequest.Create(Url);  //GetresponsefromOzekiNGSMSGatewayServerandreadtheanswer System.Net.HttpWebResponsemyResp=(System.Net.HttpWebResponse)myReq.GetResponse(); System.IO.StreamReaderrespStreamReader=newSystem.IO.StreamReader(myResp.GetResponseStream()); stringresponseString=respStreamReader.ReadToEnd(); respStreamReader.Close(); myResp.Close();  //informtheuser  } catch(Exceptionex) { throwex; //ifsendingrequestorgettingresponseisnotsuccessful,OzekiNG-SMSGatewayServermaynotberunning  }  }/span/pre/code
devildx2050:一般这个错误发生时,连接已经打开,而您试图再次打开它
所以...
所有的代码放置在try块
在最后的块写为
ocon.close()
所以,当发生异常的连接将接近