如何将具有移动号码的表成员传递给URL以通过网关发送SMS [英] how to pass a table member having mobile number to URL to send SMS through a gateway
本文介绍了如何将具有移动号码的表成员传递给URL以通过网关发送SMS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表格列为电话的表格。它拥有手机号码。
我将这个''手机''分配给变量v_phone。我使用以下代码发送
短信。它不起作用。
string v_phone = ds3.Tables [0] .Rows [i] [phone]。ToString() ;
WebClient客户端=新WebClient();
string baseurl =http://sms.ssdindia.com/sendhttp.php?user=rajnamm&password=298426&mobiles=v_phone&message=hello&sender=test;
流数据= client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
如果我使用确切的手机号码代替该变量,它就可以了。任何人都可以帮帮我。
解决方案
为什么你认为v_phone字符串将被变量值替换?
你和你我试图调试v_phone字符串,你看到的是网关接受的正确格式?
尝试:
string baseurl =http://sms.ssdindia.com/sendhttp.php?user=rajnamm&password=298426&手机= + v_phone + &安培;消息=你好&安培;寄件人=试验;
I have a table with a table column named as ''phone''. It holds mobile number.
I assign this ''phone'' to a variable v_phone. I used the following code to send the
sms. It is not working.
string v_phone = ds3.Tables[0].Rows[i]["phone"].ToString(); WebClient client = new WebClient(); string baseurl = "http://sms.ssdindia.com/sendhttp.php?user=rajnamm&password=298426&mobiles=v_phone&message=hello&sender=test"; Stream data = client.OpenRead(baseurl); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); data.Close(); reader.Close();
If I use the exact mobile number in place of that variable, it is working. Can anyone help me out.
解决方案
Why do you think, that the v_phone string will be replaced by the variable value?
And you have tried to debug the v_phone string, and what you have seen there has the proper format accepted by the gateway?
Try:
string baseurl = "http://sms.ssdindia.com/sendhttp.php?user=rajnamm&password=298426&mobiles="+v_phone+"&message=hello&sender=test";
这篇关于如何将具有移动号码的表成员传递给URL以通过网关发送SMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文