SQL或.NET中的SMS或Resolve URL [英] SMS in SQL or .NET or Resolve URL
问题描述
亲爱的所有人,
我有短信包,短信服务提供商给我发送短信的链接。在该链接上需要传递参数,如数字和消息。
代码看起来像
response.redirect(http://www.xyz.com/sendsms.php?Number=123&password=123&msg=\"abc)
然后短信成功发送。但是它显示了他们的网站becoz的重定向。
如何在没有重定向的情况下在asp.net中运行。
或者我会在sql和插入中添加一个临时表的任何方式我可以触发触发器并且URL将在SQL中解析吗?
谢谢
Basit。
您可以通过客户端上的ajax调用调用该方法并抑制响应(不推荐为一些回复可能表明存在问题),
或(可能更可取的方式)你可以在服务器上调用它并抑制响应。检查响应文本中是否显示成功或失败,并显示您自己的页面。
如果您管理响应和行为,那么没有什么能阻止您这样做你自己。
你可以使用
WebRequest = System.Net.HttpWebRequest。创建跨度>(URL);
WebResonse = WebRequest.GetResponse();
System.IO.StreamReader reader = new StreamReader(WebResonse.GetResponseStream());
strWebResponse = reader.ReadToEnd();
WebResonse。关闭();
$ b $ c instrWebResponse
您将在用于发送短信的页面上显示结果显示。
有时您会收到超时错误。所以你可以增加Timeout属性。
WebRequest.Timeout = 10000 ;
Dear All,
I have SMS pack, The SMS Provider give me the link to send the sms. on that link need to pass the parameter such as number and message.
The code look like
response.redirect(http://www.xyz.com/sendsms.php?Number=123&password=123&msg="abc")
then sms successfully sent. but it shows their website becoz its redirect.
how to do in asp.net without redirect.
or any ways i will add one temp table in sql and on insert i can fire the trigger and the url will resolve in SQL?
thanks
Basit.
You could call the method via an ajax call on the client and suppress the response (not recommended as some responses may indicate there was an issue),
or (and probably a more advisable way) you could call it on the server and suppress the response. Check the response text for what ever indicates "successful" or "failure" and display your own page instead.
Nothing stops you doing that if you manage the response and behaviour yourself.
You can use
WebRequest = System.Net.HttpWebRequest.Create(URL); WebResonse = WebRequest.GetResponse(); System.IO.StreamReader reader = new StreamReader(WebResonse.GetResponseStream()); strWebResponse = reader.ReadToEnd(); WebResonse.Close();
instrWebResponse
you will get result shows on page of which you are using to send SMS.
Some times you will get Timeout error. so then you can increase Timeout property.
WebRequest.Timeout = 10000;
这篇关于SQL或.NET中的SMS或Resolve URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!