vb 手机版:[程序设计]vb代码转asp

太平洋在线下载手机版 32 0

哪位大侠帮忙把这段vb代码转为asp啊

  '本程序展示了短信控件的核心功能vb 手机版,希望能为您使用控件提供帮助

  Dim timecount As Integer

  Private Sub Check1_Click()

  If Check1.Value = 1 Then

   SMScontrol1.Autoreceive = True

   Else

   SMScontrol1.Autoreceive = False

   End If

  End Sub

  Private Sub Check2_Click()

   If Check2.Value = 1 Then

   SMScontrol1.Autodelmsg = True

   Else

   SMScontrol1.Autodelmsg = False

   End If

  End Sub

  Private Sub Combo2_Change()

  End Sub

  Private Sub Combo3_Change()

  End Sub

  Private Sub Command1_Click()

   Text1.Text = SMScontrol1.ATcommand(Combo1.Text)

  End Sub

  Private Sub Command2_Click()

  MsgBox SMScontrol1.CheckConnection

  End Sub

  Private Sub Form_Load()

  SMScontrol1.Visible = False

  SMScontrol1.SendTimeout = 8

  End Sub

  Private Sub cmdClose_Click()

   SMScontrol1.Commclose

   Unload Me

  End Sub

  Private Sub cmdConnect_Click()

   '设置串口号

   If Combo2.Text <> "" Then SMScontrol1.Commport = Right(Combo2.Text, 1)

   '设置波特率

   SMScontrol1.Setting = Combo3.Text

   '打开与手机的通讯

   If SMScontrol1.Commopen = 1 Then

   MsgBox "连接成功!"

   Else

   MsgBox "连接失败!"

   End If

  End Sub

  Private Sub cmdDisConnect_Click()

   '关闭与手机的连接

   SMScontrol1.Commclose

   MsgBox "断开成功vb 手机版!"

  End Sub

  Private Sub cmdRead_Click()

   If txtSMSNo.Text <> "" Then

   If SMScontrol1.Readmsg(Val(txtSMSNo.Text)) = 1 Then

   '从控件的属性中取得刚才读出的短信内容

   MsgBox "读短信息成功vb 手机版!"

   Else

   MsgBox "读短信息失败!"

   End If

   End If

  End Sub

  Private Sub cmdSend_Click()

   SMScontrol1.Sendmode = Trim(Text2.Text)

   ProgressBar1.Max = SMScontrol1.SendTimeout

   Timer1.Enabled = True

   timecount = 0

   ProgressBar1.Value = 0

   If SMScontrol1.Sendmode = "1" Then

   If SMScontrol1.Sendmsg(txtMobileNo.Text, txtmsg.Text, Combo4.Text) = 1 Then

   Timer1.Enabled = False

   MsgBox "发送成功vb 手机版!"

   ProgressBar1.Value = 0

   Else

   Timer1.Enabled = False

   MsgBox "发送失败vb 手机版!"

   ProgressBar1.Value = 0

   End If

   Else

   ppp = SMScontrol1.Sendmsg(txtMobileNo.Text, txtmsg.Text, Combo4.Text)

   End If

  End Sub

  Private Sub SMScontrol1_Msgreceived(ByVal arrivedate As String, ByVal arrivetime As String, ByVal smssender As String, ByVal msg As String)

   txtRec.Text = txtRec.Text + arrivedate + " " + arrivetime + " " + smssender + " " + msg + Chr(13)

  End Sub

  Private Sub SMScontrol1_Sendreport(ByVal Outmbno As String, ByVal Outmsg As String, ByVal Report As String)

   Timer1.Enabled = False

   ProgressBar1.Value = 0

   MsgBox Outmbno + " " + Outmsg + " " + Report

  End Sub

  Private Sub Text2_Change()

  End Sub

  Private Sub Timer1_Timer()

  timecount = timecount + 1

  If timecount > SMScontrol1.SendTimeout Then

  timecount = SMScontrol1.SendTimeout

  End If

  ProgressBar1.Value = timecount

  End Sub

  Private Sub txtMobileNo_Change()

  End Sub

  Private Sub txtmsg_Change()

  If Combo4.Text = "0" Then

  txtmsg.MaxLength = 140

  Else

  txtmsg.MaxLength = 70

  End If

  Label4.Caption = Str(Len(txtmsg.Text))

  End Sub

标签: 程序设计 代码 asp

抱歉,评论功能暂时关闭!