短信猫测试使用正常 发送单条信息没有问题
但是使用for each语句批量发送客户端提交过来的短信时 程序就会崩溃 请问这是什么原因
代码如下 放在计划管理里 执行间隔1分钟
Dim cmd As new SQLCommand
cmd.C
cmd.CommandText="select * from {待发件箱} where 已发送=0"
Dim dt As DataTable
dt=cmd.ExecuteReader
If dt.datarows.Count>0 Then
FoxSms.SyncWorkMode = False '设置为异步工作模式
FoxSMS.CommPort = 3
FoxSMS.OpenCom()
If FoxSMS.Ready =True Then
For Each dr As DataRow In dt.datarows
FoxSMS.SendMsg(dr("接收号码"),dr("内容"))
dr("已发送")=1
cmd.CommandText="update {待发件箱} set 已发送=1, 发送时间='" & Functions.Execute("stime","cderp") & "'" & "where 流水号='" & dr("流水号") & "'"
cmd.ExecuteNonQuery
Next
End If
FoxSMS.CloseCom()
End If