以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=62914)

--  作者:yjd
--  发布时间:2015/1/9 22:31:00
--  [求助]
甜版主,您的狐表连接手机发送短信应用发送方式太好了!请问如果数据表中有数百个手机信息,如何导入手机号群发!谢谢!
--  作者:Bin
--  发布时间:2015/1/10 8:49:00
--  
FOR each r as row in tables("X").rows
    遍历所有行
next

--  作者:yjd
--  发布时间:2015/1/10 12:08:00
--  
甜版主的代码是这样,您的代码是For Each r As Row In Tables("x").rows
Next
应该怎么修改,谢谢!


Dim server As String = e.Form.Controls("TextBox1").Text
Dim phones As String = e.Form.Controls("TextBox2").Text
Dim context As String = System.Web.HttpUtility.UrlEncode(e.Form.Controls("TextBox3").Text)
Dim url  As String = server & "/?numbers=" & phones & "&text=" & context
try
    Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
    Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
    rsps.close
    \'Dim stm As System.IO.Stream = rsps.GetResponseStream()
    \'Dim reader As New System.IO.StreamReader(stm)
    \'Dim strResult As String = reader.ReadToEnd
    \'msgbox(strResult)
    msgbox("提交发送成功")
catch ex As exception
    msgbox("发送失败,请确认服务器地址设置正确!")
End try

--  作者:Bin
--  发布时间:2015/1/10 12:17:00
--  
For Each r As Row In Tables("x").rows
 Dim server As String = e.Form.Controls("TextBox1").Text
Dim phones As String = r("号码")
Dim context As String = System.Web.HttpUtility.UrlEncode(e.Form.Controls("TextBox3").Text)
Dim url  As String = server & "/?numbers=" & phones & "&text=" & context
try
    Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
    Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
    rsps.close
    \'Dim stm As System.IO.Stream = rsps.GetResponseStream()
    \'Dim reader As New System.IO.StreamReader(stm)
    \'Dim strResult As String = reader.ReadToEnd
    \'msgbox(strResult)
    msgbox("提交发送成功")
catch ex As exception
    msgbox("发送失败,请确认服务器地址设置正确!")
End try
Next

--  作者:yjd
--  发布时间:2015/1/10 13:00:00
--  
谢谢老师,成功了。如果我在数据表中增加一个短信发送成功或失败列,代码应该怎么写。谢谢!