使用.net 3.5的批量短信发送应用程序 [英] bulk sms sending application using .net 3.5

查看:79
本文介绍了使用.net 3.5的批量短信发送应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过第三方api创建了短信发送软件.
我使用了httpresponse和httprequest对象
我用下面的代码..

I created a sms sending software by third party api.
I used httpresponse and httprequest object
I used following code..

Dim uri As New Uri("http://xx.xxx.xxx.xx/sendurl.asp?user=XX&pwd=XXX&senderid=XXX&mobileno=" & phno & "&msgtext=" & msg & "&responce=Y")
            If (uri.Scheme = uri.UriSchemeHttp) Then
                Dim request As HttpWebRequest = HttpWebRequest.Create(uri)
                request.Method = WebRequestMethods.Http.Get
                Dim response1 As HttpWebResponse = request.GetResponse()
                Dim reader As New StreamReader(response1.GetResponseStream())
                tmp = reader.ReadToEnd()
                response1.Close()
                txtResponse.Text += tmp
                ''Response.Write(tmp)
            End If


电话号码和消息存储在数据库中.
现在它可以正常工作了.
但是对于大量的客户来说,这会花费很多时间,因为在获得一个客户的响应之后,它会循环到另一个客户..
任何人都可以帮助提高发送短信的速度吗?
我有4000个客户,现在需要1.30个小时.
客户端数量可能会增加.


The phone number and message are stored in a database..
now it works properly.
But for large amounts of clients it takes lots of time as after getting response of one it loops for another..
Can anyone help to increase speed of sending sms?
I have 4000 client it takes 1.30 hrs now.
The client number may increase.

推荐答案

如果您认为瓶颈是循环而不是第三方服务器,则可以使用多个后台线程并并行发送它们.或使用线程池.这样一来,您应该会看到性能有所提高,因为您已经将瓶颈从您的身边转移到了sms服务器(这可能不是瓶颈).
If you think the bottleneck is the loop and not the 3rd party server, you could use multiple background threads and send them in parallel. Or use the thread pool. That way you should see some increase in performance since you''ve shifted the bottleneck from your side to the sms server (which is probably less of a bottleneck).


这篇关于使用.net 3.5的批量短信发送应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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