标题:[求助]为什么我的程序不能发push短信?
只看楼主
keke86
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-3-28
 问题点数:0 回复次数:0 
[求助]为什么我的程序不能发push短信?

Imports System.Timers
Imports System.Data
Imports System.Data.SqlClient
Imports System.Threading
Imports WAPPUSHLib
Module Module1

Public Sub Main()

Dim aTimer As New System.Timers.Timer
aTimer.BeginInit()
AddHandler aTimer.Elapsed, AddressOf ReadMyData
' Set the Interval to 5 seconds.
aTimer.Interval = 1000
aTimer.Enabled = True
aTimer.EndInit()

Console.WriteLine("Press 'q' to quit the sample.")
While Console.Read() <> CInt("q")

End While
End Sub

' Specify what you want to happen when the Elapsed event is raised.
Private Sub ReadMyData(ByVal source As Object, ByVal e As ElapsedEventArgs)
Dim wappush1 As New WapPushClass
wappush1.BaudRate = 115200
wappush1.ComPortNo = 1
wappush1.TimeExpires = 24

Dim myConnString As String = "server=localhost;database=ceshi_hu;uid=sa;pwd=;"
Dim myConnection As New SqlConnection(myConnString)
Dim mySelectQuery As String = "SELECT memo,cellphone,path FROM area where flag=1"
Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myReader As SqlDataReader
myReader = myCommand.ExecuteReader()
' Always call Read before accessing data.
While myReader.Read()

wappush1.PushMessage(myReader("cellphone"), myReader("memo"), myReader("path"))
Console.WriteLine((myReader("memo") & ", " & myReader("cellphone") & ", " & myReader("path")))
End While
' always call Close when done reading.
myReader.Close()
' Close the connection when done with it.
myConnection.Close()
End Sub
End Module

搜索更多相关主题的帖子: push 短信 
2006-03-28 22:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-53562-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.369806 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved