http通过vb .net webclient发布 [英] http post through vb .net webclient

查看:257
本文介绍了http通过vb .net webclient发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想创建一个连接到Web服务器的短信发送应用程序,并通过http方法发布将短信发送到指定的手机号码,该网站有一个api要做到这一点,我的事情是java中有一个jsp扩展,我会给你api命令和参数,我相信它在VB .Net中工作的代码,如果你能告诉我它是否有任何错误。

http: messaging.smscanal.com/sms/sendsms.jsp

和参数 messaging.smscanal .com / sms / sendsms.jsp?user = username& password = password& mobiles = 30XXXXXXXX& sms = msgbody

.jsp api参数:

a )用户:Telexxx(短信公司)账户的用户ID

b)密码:上述用户的有效密码

c)手机:逗号分隔的手机号码将在哪个手机上传送(例如9824012345,98XXXXXXXX)。您可以使用的手机或组名称。您一次只能使用一个参数手机或组名

d)短信:您要发送给客户的短信(例如测试信息)

和代码我在VB中找到.net

Hi,
I want to create an sms send application which connects to a web server and through http method "post" send the sms text message to the specified mobile number, the site has an api to do it, I thing is in java has a jsp extension, I will give you the api commands and parameters also the code I believe it works in VB .Net and if you can tell me if it has any errors.
the http : messaging.smscanal.com/sms/sendsms.jsp
and the parameters messaging.smscanal.com/sms/sendsms.jsp?user=username&password=password&mobiles=30XXXXXXXX&sms=msgbody
the .jsp api parameters :
a)user : user id of the Telexxx (sms company) account
b)password : valid password of above user
c)mobiles : comma separated mobile numbers on which message will be deliver(e.g. 9824012345,98XXXXXXXX) .Either of mobiles or group name you can use. At a time you can use only one parameter either mobiles or groupname
d)sms : SMS text which you want to send to your customer (e.g. Test message)
and the code I found in VB .net

Using client As New Net.WebClient
    Dim reqparm As New Specialized.NameValueCollection
    reqparm.Add("param1", "somevalue")
    reqparm.Add("param2", "othervalue")
    reqparm.Add("param3", "othervalue")
    reqparm.Add("param4", "othervalue")
    Dim responsebytes = client.UploadValues(http// : messaging.smscanal.com/sms/sendsms.jsp?user="param1"&password="param2"&mobiles="param3"&sms="param4", "POST")
    Dim responsebody = (New Text.UTF8Encoding).GetString(responsebytes)
End Using

推荐答案

这篇关于http通过vb .net webclient发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆