123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800 |
- Public Class FrmDemo
- Inherits System.Windows.Forms.Form
- ''MonGatekf.dll
- 'Private Declare Function MongateConnect Lib "mongatekf.dll" (ByVal ip As String, ByVal port As Integer, ByVal account As String, ByVal pwd As String) As Integer
- 'Private Declare Function MongateDisConnect Lib "mongatekf.dll" (ByVal clientsock As Integer) As Integer
- 'Private Declare Function MongateSendSms Lib "mongatekf.dll" (ByVal clientsock As Integer, ByVal mobi As String, ByVal note As String, ByRef msgnumber As Byte) As Integer
- ''Private Declare Function MongateSendSingleSms Lib "mongatekf.dll" (ByVal clientsock As Integer, ByVal mobi As String, ByVal note As String, ByRef msgnumber As Byte) As Integer
- ''Private Declare Function MongateSendMultSms Lib "mongatekf.dll" (ByVal clientsock As Integer, ByVal mobi As String, ByVal note As String, ByVal mobinum As Integer, ByRef msgnumber As Byte) As Integer
- 'Private Declare Function MongateGetSms Lib "mongatekf.dll" (ByVal clientsock As Integer, ByRef recvbuf As Byte) As Integer
- Private Declare Function MongateGetStatus Lib "mongatekf.dll" (ByVal clientsock As Integer, ByRef recvbuf As Byte) As Integer
- 'MWGateway.dll
- Private Declare Function MongateConnect Lib "MWGateway.dll" (ByVal serverip As String, _
- ByVal port As Integer, ByVal account As String, ByVal pwd As String) As Integer
- Private Declare Function MongateSendSms Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByVal mobi As String, ByVal msg As String) As Integer
- Private Declare Function MongateTestConn Lib "MWGateway.dll" (ByVal socket As Integer) As Integer
- Private Declare Function MongateQueryBalance Lib "MWGateway.dll" (ByVal socket As Integer) As Integer
- Private Declare Function MongateQueryUsed Lib "MWGateway.dll" (ByVal socket As Integer) As Integer
- Private Declare Function MongateRecharge Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByVal cardno As String, ByVal cardpwd As String) As Integer
- Private Declare Function MongateChangePwd Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByVal account As String, ByVal oldpwd As String, ByVal newpwd As String) As Integer
- Private Declare Sub MongateDisconnect Lib "MWGateway.dll" (ByVal socket As Integer)
- Private Declare Function MongateVasGetSms Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByRef recvmsg As Byte) As Integer
- Private Declare Function MongateVasSendSms Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByVal feecode As String, ByVal spno As String, ByVal opercode As String, _
- ByVal linkid As String, ByVal mobis As String, ByVal msg As String, _
- ByVal icount As Integer) As Integer
- Private Declare Function MongateCsGetSms Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByRef statereport As Byte) As Integer
- Private Declare Function MongateCsSendSms Lib "MWGateway.dll" (ByVal socket As Integer, _
- ByVal mobi As String, ByVal note As String, ByVal icount As Integer, _
- ByRef msgno As Byte) As Integer
- Private Declare Function MongateCsGetStatusReport Lib "MWGateway.dll" _
- (ByVal socket As Integer, ByRef recvmsg As Byte) As Integer
- Dim clientsock As Integer
- #Region " Windows 窗体设计器生成的代码 "
- Public Sub New()
- MyBase.New()
- '该调用是 Windows 窗体设计器所必需的。
- InitializeComponent()
- '在 InitializeComponent() 调用之后添加任何初始化
- End Sub
- '窗体重写 dispose 以清理组件列表。
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- 'Windows 窗体设计器所必需的
- Private components As System.ComponentModel.IContainer
- '注意: 以下过程是 Windows 窗体设计器所必需的
- '可以使用 Windows 窗体设计器修改此过程。
- '不要使用代码编辑器修改它。
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents CkSingle As System.Windows.Forms.CheckBox
- Friend WithEvents CkVas As System.Windows.Forms.CheckBox
- Friend WithEvents Ckkf As System.Windows.Forms.CheckBox
- Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
- Friend WithEvents TxtPort As System.Windows.Forms.TextBox
- Friend WithEvents TxtIp As System.Windows.Forms.TextBox
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents Label19 As System.Windows.Forms.Label
- Friend WithEvents TxtPwd As System.Windows.Forms.TextBox
- Friend WithEvents TxtAccount As System.Windows.Forms.TextBox
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents BtnConn As System.Windows.Forms.Button
- Friend WithEvents BtnTest As System.Windows.Forms.Button
- Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
- Friend WithEvents TxtMsg As System.Windows.Forms.TextBox
- Friend WithEvents Label4 As System.Windows.Forms.Label
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents BtnDisConn As System.Windows.Forms.Button
- Friend WithEvents Btnreport As System.Windows.Forms.Button
- Friend WithEvents BtnRecv As System.Windows.Forms.Button
- Friend WithEvents BtnSend As System.Windows.Forms.Button
- Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
- Friend WithEvents ListInfo As System.Windows.Forms.ListBox
- Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox
- Friend WithEvents Label7 As System.Windows.Forms.Label
- Friend WithEvents Label8 As System.Windows.Forms.Label
- Friend WithEvents TxtCount As System.Windows.Forms.TextBox
- Friend WithEvents Label9 As System.Windows.Forms.Label
- Friend WithEvents Label10 As System.Windows.Forms.Label
- Friend WithEvents TxtPhone As System.Windows.Forms.TextBox
- Friend WithEvents Label11 As System.Windows.Forms.Label
- Friend WithEvents TxtLinkid As System.Windows.Forms.TextBox
- Friend WithEvents TxtFee As System.Windows.Forms.TextBox
- Friend WithEvents TxtSPort As System.Windows.Forms.TextBox
- Friend WithEvents TxtNewPwd As System.Windows.Forms.TextBox
- Friend WithEvents BtnChangePwd As System.Windows.Forms.Button
- Friend WithEvents BtnLeft As System.Windows.Forms.Button
- Friend WithEvents BtnUsed As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.Ckkf = New System.Windows.Forms.CheckBox
- Me.CkVas = New System.Windows.Forms.CheckBox
- Me.CkSingle = New System.Windows.Forms.CheckBox
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.BtnDisConn = New System.Windows.Forms.Button
- Me.BtnTest = New System.Windows.Forms.Button
- Me.BtnConn = New System.Windows.Forms.Button
- Me.TxtPwd = New System.Windows.Forms.TextBox
- Me.TxtAccount = New System.Windows.Forms.TextBox
- Me.Label2 = New System.Windows.Forms.Label
- Me.Label1 = New System.Windows.Forms.Label
- Me.TxtPort = New System.Windows.Forms.TextBox
- Me.TxtIp = New System.Windows.Forms.TextBox
- Me.Label5 = New System.Windows.Forms.Label
- Me.Label19 = New System.Windows.Forms.Label
- Me.GroupBox3 = New System.Windows.Forms.GroupBox
- Me.TxtPhone = New System.Windows.Forms.TextBox
- Me.Label11 = New System.Windows.Forms.Label
- Me.TxtLinkid = New System.Windows.Forms.TextBox
- Me.Label10 = New System.Windows.Forms.Label
- Me.TxtCount = New System.Windows.Forms.TextBox
- Me.Label9 = New System.Windows.Forms.Label
- Me.TxtFee = New System.Windows.Forms.TextBox
- Me.Label8 = New System.Windows.Forms.Label
- Me.Btnreport = New System.Windows.Forms.Button
- Me.BtnRecv = New System.Windows.Forms.Button
- Me.BtnSend = New System.Windows.Forms.Button
- Me.TxtMsg = New System.Windows.Forms.TextBox
- Me.TxtSPort = New System.Windows.Forms.TextBox
- Me.Label4 = New System.Windows.Forms.Label
- Me.Label3 = New System.Windows.Forms.Label
- Me.GroupBox4 = New System.Windows.Forms.GroupBox
- Me.ListInfo = New System.Windows.Forms.ListBox
- Me.GroupBox5 = New System.Windows.Forms.GroupBox
- Me.TxtNewPwd = New System.Windows.Forms.TextBox
- Me.Label7 = New System.Windows.Forms.Label
- Me.BtnChangePwd = New System.Windows.Forms.Button
- Me.BtnLeft = New System.Windows.Forms.Button
- Me.BtnUsed = New System.Windows.Forms.Button
- Me.GroupBox1.SuspendLayout()
- Me.GroupBox2.SuspendLayout()
- Me.GroupBox3.SuspendLayout()
- Me.GroupBox4.SuspendLayout()
- Me.GroupBox5.SuspendLayout()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.Ckkf)
- Me.GroupBox1.Controls.Add(Me.CkVas)
- Me.GroupBox1.Controls.Add(Me.CkSingle)
- Me.GroupBox1.Location = New System.Drawing.Point(9, 0)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(415, 40)
- Me.GroupBox1.TabIndex = 14
- Me.GroupBox1.TabStop = False
- Me.GroupBox1.Text = "帐户类型"
- '
- 'Ckkf
- '
- Me.Ckkf.Location = New System.Drawing.Point(296, 15)
- Me.Ckkf.Name = "Ckkf"
- Me.Ckkf.Size = New System.Drawing.Size(112, 23)
- Me.Ckkf.TabIndex = 18
- Me.Ckkf.Text = "客服双向帐户"
- '
- 'CkVas
- '
- Me.CkVas.Location = New System.Drawing.Point(156, 15)
- Me.CkVas.Name = "CkVas"
- Me.CkVas.Size = New System.Drawing.Size(112, 23)
- Me.CkVas.TabIndex = 17
- Me.CkVas.Text = "增值双向帐户"
- '
- 'CkSingle
- '
- Me.CkSingle.Checked = True
- Me.CkSingle.CheckState = System.Windows.Forms.CheckState.Checked
- Me.CkSingle.Location = New System.Drawing.Point(19, 15)
- Me.CkSingle.Name = "CkSingle"
- Me.CkSingle.Size = New System.Drawing.Size(112, 23)
- Me.CkSingle.TabIndex = 16
- Me.CkSingle.Text = "单向帐户"
- '
- 'GroupBox2
- '
- Me.GroupBox2.Controls.Add(Me.BtnDisConn)
- Me.GroupBox2.Controls.Add(Me.BtnTest)
- Me.GroupBox2.Controls.Add(Me.BtnConn)
- Me.GroupBox2.Controls.Add(Me.TxtPwd)
- Me.GroupBox2.Controls.Add(Me.TxtAccount)
- Me.GroupBox2.Controls.Add(Me.Label2)
- Me.GroupBox2.Controls.Add(Me.Label1)
- Me.GroupBox2.Controls.Add(Me.TxtPort)
- Me.GroupBox2.Controls.Add(Me.TxtIp)
- Me.GroupBox2.Controls.Add(Me.Label5)
- Me.GroupBox2.Controls.Add(Me.Label19)
- Me.GroupBox2.Location = New System.Drawing.Point(8, 40)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(416, 73)
- Me.GroupBox2.TabIndex = 15
- Me.GroupBox2.TabStop = False
- Me.GroupBox2.Text = "帐户登陆"
- '
- 'BtnDisConn
- '
- Me.BtnDisConn.Enabled = False
- Me.BtnDisConn.Location = New System.Drawing.Point(354, 16)
- Me.BtnDisConn.Name = "BtnDisConn"
- Me.BtnDisConn.Size = New System.Drawing.Size(55, 23)
- Me.BtnDisConn.TabIndex = 18
- Me.BtnDisConn.Text = "断开"
- '
- 'BtnTest
- '
- Me.BtnTest.Location = New System.Drawing.Point(296, 43)
- Me.BtnTest.Name = "BtnTest"
- Me.BtnTest.Size = New System.Drawing.Size(113, 23)
- Me.BtnTest.TabIndex = 17
- Me.BtnTest.Text = "测试连接"
- '
- 'BtnConn
- '
- Me.BtnConn.Location = New System.Drawing.Point(296, 16)
- Me.BtnConn.Name = "BtnConn"
- Me.BtnConn.Size = New System.Drawing.Size(55, 23)
- Me.BtnConn.TabIndex = 15
- Me.BtnConn.Text = "连接"
- '
- 'TxtPwd
- '
- Me.TxtPwd.Location = New System.Drawing.Point(212, 42)
- Me.TxtPwd.Name = "TxtPwd"
- Me.TxtPwd.PasswordChar = Microsoft.VisualBasic.ChrW(42)
- Me.TxtPwd.Size = New System.Drawing.Size(60, 21)
- Me.TxtPwd.TabIndex = 14
- Me.TxtPwd.Text = "807778"
- '
- 'TxtAccount
- '
- Me.TxtAccount.Location = New System.Drawing.Point(48, 42)
- Me.TxtAccount.Name = "TxtAccount"
- Me.TxtAccount.Size = New System.Drawing.Size(120, 21)
- Me.TxtAccount.TabIndex = 13
- Me.TxtAccount.Text = "13888888888"
- '
- 'Label2
- '
- Me.Label2.Location = New System.Drawing.Point(176, 44)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(40, 21)
- Me.Label2.TabIndex = 12
- Me.Label2.Text = "密码:"
- '
- 'Label1
- '
- Me.Label1.Location = New System.Drawing.Point(7, 44)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(40, 21)
- Me.Label1.TabIndex = 11
- Me.Label1.Text = "帐号:"
- '
- 'TxtPort
- '
- Me.TxtPort.Location = New System.Drawing.Point(212, 16)
- Me.TxtPort.Name = "TxtPort"
- Me.TxtPort.Size = New System.Drawing.Size(60, 21)
- Me.TxtPort.TabIndex = 10
- Me.TxtPort.Text = "8018"
- '
- 'TxtIp
- '
- Me.TxtIp.Location = New System.Drawing.Point(48, 16)
- Me.TxtIp.Name = "TxtIp"
- Me.TxtIp.Size = New System.Drawing.Size(120, 21)
- Me.TxtIp.TabIndex = 9
- Me.TxtIp.Text = "61.242.89.115"
- '
- 'Label5
- '
- Me.Label5.Location = New System.Drawing.Point(176, 21)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(40, 16)
- Me.Label5.TabIndex = 8
- Me.Label5.Text = "端口:"
- '
- 'Label19
- '
- Me.Label19.Location = New System.Drawing.Point(5, 21)
- Me.Label19.Name = "Label19"
- Me.Label19.Size = New System.Drawing.Size(48, 16)
- Me.Label19.TabIndex = 7
- Me.Label19.Text = "服务器:"
- '
- 'GroupBox3
- '
- Me.GroupBox3.Controls.Add(Me.TxtPhone)
- Me.GroupBox3.Controls.Add(Me.Label11)
- Me.GroupBox3.Controls.Add(Me.TxtLinkid)
- Me.GroupBox3.Controls.Add(Me.Label10)
- Me.GroupBox3.Controls.Add(Me.TxtCount)
- Me.GroupBox3.Controls.Add(Me.Label9)
- Me.GroupBox3.Controls.Add(Me.TxtFee)
- Me.GroupBox3.Controls.Add(Me.Label8)
- Me.GroupBox3.Controls.Add(Me.Btnreport)
- Me.GroupBox3.Controls.Add(Me.BtnRecv)
- Me.GroupBox3.Controls.Add(Me.BtnSend)
- Me.GroupBox3.Controls.Add(Me.TxtMsg)
- Me.GroupBox3.Controls.Add(Me.TxtSPort)
- Me.GroupBox3.Controls.Add(Me.Label4)
- Me.GroupBox3.Controls.Add(Me.Label3)
- Me.GroupBox3.Location = New System.Drawing.Point(8, 112)
- Me.GroupBox3.Name = "GroupBox3"
- Me.GroupBox3.Size = New System.Drawing.Size(416, 144)
- Me.GroupBox3.TabIndex = 16
- Me.GroupBox3.TabStop = False
- Me.GroupBox3.Text = "信息操作"
- '
- 'TxtPhone
- '
- Me.TxtPhone.Location = New System.Drawing.Point(64, 39)
- Me.TxtPhone.Name = "TxtPhone"
- Me.TxtPhone.Size = New System.Drawing.Size(229, 21)
- Me.TxtPhone.TabIndex = 23
- Me.TxtPhone.Text = "13534***346"
- '
- 'Label11
- '
- Me.Label11.Location = New System.Drawing.Point(9, 43)
- Me.Label11.Name = "Label11"
- Me.Label11.Size = New System.Drawing.Size(60, 17)
- Me.Label11.TabIndex = 22
- Me.Label11.Text = "手机号码:"
- '
- 'TxtLinkid
- '
- Me.TxtLinkid.Location = New System.Drawing.Point(296, 14)
- Me.TxtLinkid.Name = "TxtLinkid"
- Me.TxtLinkid.Size = New System.Drawing.Size(111, 21)
- Me.TxtLinkid.TabIndex = 21
- Me.TxtLinkid.Text = ""
- '
- 'Label10
- '
- Me.Label10.Location = New System.Drawing.Point(252, 18)
- Me.Label10.Name = "Label10"
- Me.Label10.Size = New System.Drawing.Size(48, 17)
- Me.Label10.TabIndex = 20
- Me.Label10.Text = "匹配码:"
- '
- 'TxtCount
- '
- Me.TxtCount.Location = New System.Drawing.Point(352, 39)
- Me.TxtCount.Name = "TxtCount"
- Me.TxtCount.Size = New System.Drawing.Size(53, 21)
- Me.TxtCount.TabIndex = 19
- Me.TxtCount.Text = "1"
- '
- 'Label9
- '
- Me.Label9.Location = New System.Drawing.Point(296, 43)
- Me.Label9.Name = "Label9"
- Me.Label9.Size = New System.Drawing.Size(60, 17)
- Me.Label9.TabIndex = 18
- Me.Label9.Text = "手机个数:"
- '
- 'TxtFee
- '
- Me.TxtFee.Location = New System.Drawing.Point(200, 14)
- Me.TxtFee.Name = "TxtFee"
- Me.TxtFee.Size = New System.Drawing.Size(50, 21)
- Me.TxtFee.TabIndex = 17
- Me.TxtFee.Text = ""
- '
- 'Label8
- '
- Me.Label8.Location = New System.Drawing.Point(144, 18)
- Me.Label8.Name = "Label8"
- Me.Label8.Size = New System.Drawing.Size(60, 17)
- Me.Label8.TabIndex = 16
- Me.Label8.Text = "费率代码:"
- '
- 'Btnreport
- '
- Me.Btnreport.Enabled = False
- Me.Btnreport.Location = New System.Drawing.Point(311, 116)
- Me.Btnreport.Name = "Btnreport"
- Me.Btnreport.Size = New System.Drawing.Size(95, 23)
- Me.Btnreport.TabIndex = 15
- Me.Btnreport.Text = "状态报告"
- '
- 'BtnRecv
- '
- Me.BtnRecv.Enabled = False
- Me.BtnRecv.Location = New System.Drawing.Point(311, 91)
- Me.BtnRecv.Name = "BtnRecv"
- Me.BtnRecv.Size = New System.Drawing.Size(95, 23)
- Me.BtnRecv.TabIndex = 14
- Me.BtnRecv.Text = "接收信息"
- '
- 'BtnSend
- '
- Me.BtnSend.Location = New System.Drawing.Point(311, 66)
- Me.BtnSend.Name = "BtnSend"
- Me.BtnSend.Size = New System.Drawing.Size(95, 23)
- Me.BtnSend.TabIndex = 13
- Me.BtnSend.Text = "单向信息"
- '
- 'TxtMsg
- '
- Me.TxtMsg.Location = New System.Drawing.Point(64, 64)
- Me.TxtMsg.Multiline = True
- Me.TxtMsg.Name = "TxtMsg"
- Me.TxtMsg.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
- Me.TxtMsg.Size = New System.Drawing.Size(229, 73)
- Me.TxtMsg.TabIndex = 12
- Me.TxtMsg.Text = "恭喜发财,测试信息"
- '
- 'TxtSPort
- '
- Me.TxtSPort.Location = New System.Drawing.Point(64, 14)
- Me.TxtSPort.Name = "TxtSPort"
- Me.TxtSPort.Size = New System.Drawing.Size(78, 21)
- Me.TxtSPort.TabIndex = 11
- Me.TxtSPort.Text = ""
- '
- 'Label4
- '
- Me.Label4.Location = New System.Drawing.Point(16, 64)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(40, 17)
- Me.Label4.TabIndex = 10
- Me.Label4.Text = "内容:"
- '
- 'Label3
- '
- Me.Label3.Location = New System.Drawing.Point(9, 18)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(60, 17)
- Me.Label3.TabIndex = 9
- Me.Label3.Text = "端口号码:"
- '
- 'GroupBox4
- '
- Me.GroupBox4.Controls.Add(Me.ListInfo)
- Me.GroupBox4.Location = New System.Drawing.Point(8, 304)
- Me.GroupBox4.Name = "GroupBox4"
- Me.GroupBox4.Size = New System.Drawing.Size(416, 112)
- Me.GroupBox4.TabIndex = 20
- Me.GroupBox4.TabStop = False
- Me.GroupBox4.Text = "提示信息"
- '
- 'ListInfo
- '
- Me.ListInfo.HorizontalScrollbar = True
- Me.ListInfo.ItemHeight = 12
- Me.ListInfo.Location = New System.Drawing.Point(8, 16)
- Me.ListInfo.Name = "ListInfo"
- Me.ListInfo.Size = New System.Drawing.Size(400, 88)
- Me.ListInfo.TabIndex = 5
- '
- 'GroupBox5
- '
- Me.GroupBox5.Controls.Add(Me.TxtNewPwd)
- Me.GroupBox5.Controls.Add(Me.Label7)
- Me.GroupBox5.Controls.Add(Me.BtnChangePwd)
- Me.GroupBox5.Controls.Add(Me.BtnLeft)
- Me.GroupBox5.Controls.Add(Me.BtnUsed)
- Me.GroupBox5.Location = New System.Drawing.Point(8, 257)
- Me.GroupBox5.Name = "GroupBox5"
- Me.GroupBox5.Size = New System.Drawing.Size(416, 43)
- Me.GroupBox5.TabIndex = 21
- Me.GroupBox5.TabStop = False
- Me.GroupBox5.Text = "帐户管理"
- '
- 'TxtNewPwd
- '
- Me.TxtNewPwd.Location = New System.Drawing.Point(336, 16)
- Me.TxtNewPwd.Name = "TxtNewPwd"
- Me.TxtNewPwd.PasswordChar = Microsoft.VisualBasic.ChrW(42)
- Me.TxtNewPwd.Size = New System.Drawing.Size(60, 21)
- Me.TxtNewPwd.TabIndex = 24
- Me.TxtNewPwd.Text = ""
- '
- 'Label7
- '
- Me.Label7.Location = New System.Drawing.Point(292, 21)
- Me.Label7.Name = "Label7"
- Me.Label7.Size = New System.Drawing.Size(40, 16)
- Me.Label7.TabIndex = 23
- Me.Label7.Text = "密码:"
- '
- 'BtnChangePwd
- '
- Me.BtnChangePwd.Location = New System.Drawing.Point(200, 16)
- Me.BtnChangePwd.Name = "BtnChangePwd"
- Me.BtnChangePwd.TabIndex = 22
- Me.BtnChangePwd.Text = "修改密码"
- '
- 'BtnLeft
- '
- Me.BtnLeft.Location = New System.Drawing.Point(104, 16)
- Me.BtnLeft.Name = "BtnLeft"
- Me.BtnLeft.TabIndex = 21
- Me.BtnLeft.Text = "查询余额"
- '
- 'BtnUsed
- '
- Me.BtnUsed.Location = New System.Drawing.Point(8, 16)
- Me.BtnUsed.Name = "BtnUsed"
- Me.BtnUsed.TabIndex = 20
- Me.BtnUsed.Text = "查询使用"
- '
- 'FrmDemo
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(438, 434)
- Me.Controls.Add(Me.GroupBox5)
- Me.Controls.Add(Me.GroupBox4)
- Me.Controls.Add(Me.GroupBox3)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "FrmDemo"
- Me.Text = "梦网网关动态库演示程序"
- Me.GroupBox1.ResumeLayout(False)
- Me.GroupBox2.ResumeLayout(False)
- Me.GroupBox3.ResumeLayout(False)
- Me.GroupBox4.ResumeLayout(False)
- Me.GroupBox5.ResumeLayout(False)
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- clientsock = 0
- CkClick(0)
- End Sub
- Function Noconn() As Boolean
- Noconn = False
- If clientsock <= 0 Then
- ListInfo.Items.Add("没有连接到任何服务器!!!")
- Noconn = True
- End If
- End Function
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
-
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
- If (clientsock > 0) Then
- MongateDisconnect(clientsock)
- ListInfo.Items.Add("断开连接")
- clientsock = 0
- End If
- End Sub
- Private Sub Showme(ByVal edtmp As TextBox, ByVal flag As Boolean)
- edtmp.Enabled = flag
- If flag Then
- edtmp.BackColor = SystemColors.Window
- Else
- edtmp.BackColor = SystemColors.ScrollBar
- End If
- End Sub
- Private Sub CkClick(ByVal seltype As Integer)
- If seltype = 0 Then
- If CkSingle.Checked Then
- CkVas.Checked = 0
- Ckkf.Checked = 0
- End If
- ElseIf seltype = 1 Then
- If CkVas.Checked Then
- CkSingle.Checked = 0
- Ckkf.Checked = 0
- End If
- Else
- If Ckkf.Checked Then
- CkVas.Checked = 0
- CkSingle.Checked = 0
- End If
- End If
- Showme(TxtSPort, CkVas.Checked)
- Showme(TxtFee, CkVas.Checked)
- Showme(TxtLinkid, CkVas.Checked)
- Showme(TxtCount, (CkVas.Checked Or Ckkf.Checked))
- BtnRecv.Enabled = CkVas.Checked Or Ckkf.Checked
- Btnreport.Enabled = Ckkf.Checked
- If CkVas.Checked Then
- BtnSend.Text = "增值信息"
- ElseIf Ckkf.Checked Then
- BtnSend.Text = "客服信息"
- Else
- BtnSend.Text = "单向信息"
- End If
- End Sub
- Private Sub CkSingle_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CkSingle.CheckedChanged
- CkClick(0)
- End Sub
- Private Sub CkVas_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CkVas.CheckedChanged
- CkClick(1)
- End Sub
- Private Sub Ckkf_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ckkf.CheckedChanged
- CkClick(2)
- End Sub
- Private Sub BtnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTest.Click
- If Noconn() Then Exit Sub
- Dim retu_state As Integer
- If (clientsock > 0) Then
- retu_state = MongateTestConn(clientsock)
- If retu_state = 1 Then
- ListInfo.Items.Add("测试连接成功")
- Else
- ListInfo.Items.Add("测试连接失败")
- clientsock = 0
- BtnConn.Enabled = True
- BtnDisConn.Enabled = False
- End If
- End If
- End Sub
- Private Sub BtnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSend.Click
- If Noconn() Then Exit Sub
- Dim retu_state As Long, icount As Integer
- Dim retu_msgnumber(40) As Byte
- If Noconn() Then Exit Sub
- If Trim(TxtCount.Text) = "" Then
- icount = 1
- Else
- icount = CInt(TxtCount.Text)
- End If
- If CkVas.Checked Then '//增值信息
- retu_state = MongateVasSendSms(clientsock, Trim(TxtFee.Text), _
- Trim(TxtSPort.Text), "00********", Trim(TxtLinkid.Text), _
- Trim(TxtPhone.Text), Trim(TxtMsg.Text), icount)
- If (retu_state = 1) Then
- ListInfo.Items.Add("发送增值信息成功!")
- Else
- ListInfo.Items.Add("发送增值信息失败!返回:" + CStr(retu_state))
- End If
- ElseIf Ckkf.Checked Then '//客服信息
- retu_state = MongateCsSendSms(clientsock, Trim(TxtPhone.Text), _
- Trim(TxtMsg.Text), icount, retu_msgnumber(0))
- If (retu_state = 1) Then
- ListInfo.Items.Add("发送客服信息成功!信息编号:" _
- + System.Text.Encoding.GetEncoding("gb2312").GetString(retu_msgnumber).ToString())
- Else
- ListInfo.Items.Add("发送客服信息失败!返回:" + CStr(retu_state))
- End If
- Else '单向信息
- retu_state = MongateSendSms(clientsock, TxtPhone.Text, TxtMsg.Text)
- If (retu_state = 1) Then
- ListInfo.Items.Add("发送成功")
- Else
- ListInfo.Items.Add("发送失败")
- End If
- End If
- End Sub
- Private Sub BtnRecv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRecv.Click
- If Noconn() Then Exit Sub
- Dim recv(500, 254) As Byte
- Dim buf(255) As Byte
- Dim Str As String
- Dim num As Integer
- Dim i As Integer
- Dim k As Integer
- If (clientsock > 0) Then
- If Ckkf.Checked Then
- num = MongateCsGetSms(clientsock, recv(0, 0))
- Else
- num = MongateVasGetSms(clientsock, recv(0, 0))
- End If
- If (num > 0) Then
- For i = 0 To num - 1
- For k = 0 To 254
- buf(k) = recv(i, k)
- If (buf(k) = 0) Then
- Exit For
- End If
- Next
- Str = System.Text.Encoding.GetEncoding("gb2312").GetString(buf).ToString()
- ListInfo.Items.Add("接收信息:" & Str)
- Next
- Else
- ListInfo.Items.Add("接收无信息")
- End If
- End If
- End Sub
- Private Sub Btnreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnreport.Click
- Dim recv(500, 254) As Byte
- Dim buf(255) As Byte
- Dim Str As String
- Dim num As Integer
- Dim i As Integer
- Dim k As Integer
- If (clientsock > 0) Then
- num = MongateCsGetStatusReport(clientsock, recv(0, 0))
- If (num > 0) Then
- For i = 0 To num - 1
- For k = 0 To 254
- buf(k) = recv(i, k)
- If (buf(k) = 0) Then
- Exit For
- End If
- Next
- Str = System.Text.Encoding.GetEncoding("gb2312").GetString(buf).ToString()
- ListInfo.Items.Add("状态报告:" & Str)
- Next
- Else
- ListInfo.Items.Add("无状态报告")
- End If
- End If
- End Sub
- Private Sub BtnUsed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnUsed.Click
- If Noconn() Then Exit Sub
- Dim myfee As Integer
- Dim myip As String, myport As String
- If (clientsock > 0) Then
- myfee = MongateQueryUsed(clientsock)
- If (myfee >= 0) Then
- ListInfo.Items.Add("查询使用成功" & myfee)
- Else
- ListInfo.Items.Add("查询使用失败" & myfee)
- End If
- End If
- End Sub
- Private Sub BtnLeft_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLeft.Click
- If Noconn() Then Exit Sub
- Dim myfee As Integer
- Dim myip As String, myport As String
- If (clientsock > 0) Then
- myfee = MongateQueryBalance(clientsock)
- If (myfee >= 0) Then
- ListInfo.Items.Add("查询余额成功" & myfee)
- Else
- ListInfo.Items.Add("查询余额失败" & myfee)
- End If
- End If
- End Sub
- Private Sub BtnChangePwd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnChangePwd.Click
- If Noconn() Then Exit Sub
- Dim myfee As Integer
- Dim myip As String, myport As String
- If (clientsock > 0) Then
- myfee = MongateChangePwd(clientsock, Trim(TxtAccount.Text), _
- Trim(TxtPwd.Text), Trim(TxtNewPwd.Text))
- If (myfee >= 0) Then
- ListInfo.Items.Add("修改密码成功,请记住新密码")
- Else
- ListInfo.Items.Add("修改密码失败")
- End If
- End If
- End Sub
- Private Sub BtnConn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnConn.Click
- If (clientsock <= 0) Then
- clientsock = MongateConnect(Trim(TxtIp.Text), CInt(Trim(TxtPort.Text)), _
- Trim(TxtAccount.Text), Trim(TxtPwd.Text))
- If (clientsock > 0) Then
- ListInfo.Items.Add("连接成功,句柄:" & clientsock)
- BtnConn.Enabled = False
- BtnDisConn.Enabled = True
- Else
- ListInfo.Items.Add("连接失败,返回:" & clientsock)
- End If
- End If
- End Sub
- Private Sub BtnDisConn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnDisConn.Click
- If (clientsock > 0) Then
- MongateDisconnect(clientsock)
- ListInfo.Items.Add("断开连接,句柄:" + CStr(clientsock))
- clientsock = 0
- BtnConn.Enabled = True
- BtnDisConn.Enabled = False
- End If
- End Sub
- End Class
|