去年接触了联通的“定位之星”增值业务,客户端都是php的(说到php,真的发现以前太小看php了,功能还是很强大的,呵呵),因为联通不开通开发测试,所以自己写了这个模拟器,功能非常简陋,纯粹是为了测试通信存在。
废话少说,源码贴上(赘姆烂壳的老规矩,没多少注释)
frmMain.frm
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "L1 Protocol GateWay"
ClientHeight = 5430
ClientLeft = 45
ClientTop = 330
ClientWidth = 7995
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5430
ScaleWidth = 7995
StartUpPosition = 2 'CenterScreen
Begin VB.Timer tmrTimeOut
Interval = 1000
Left = 7560
Top = 4980
End
Begin VB.CommandButton cmdExit
Caption = "E&xit"
Height = 495
Left = 6660
TabIndex = 5
Top = 4800
Width = 1215
End
Begin VB.CommandButton cmdStop
Caption = "S&top"
Height = 495
Left = 6660
TabIndex = 4
Top = 4200
Width = 1215
End
Begin VB.CommandButton cmdLTRTask
Caption = "<R Task"
Height = 495
Left = 5340
TabIndex = 3
Top &nbs