?? frm_ip.frm
字號:
VERSION 5.00
Object = "{2B12169D-6738-11D2-BF5B-00A024982E5B}#31.8#0"; "CoolButton.OCX"
Begin VB.Form frm_ip
BorderStyle = 3 'Fixed Dialog
Caption = "GPRS用電管理系統"
ClientHeight = 1395
ClientLeft = 45
ClientTop = 330
ClientWidth = 5415
Icon = "frm_ip.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1395
ScaleWidth = 5415
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin TButton.axButton xpcmdbutton1
Height = 330
Left = 4320
TabIndex = 4
Top = 360
Width = 975
_ExtentX = 1720
_ExtentY = 582
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "請求IP"
MaskColor = -2147483633
End
Begin VB.TextBox txt_ip
Appearance = 0 'Flat
Height = 330
Left = 1800
TabIndex = 3
Top = 960
Width = 2295
End
Begin VB.TextBox txt_sim
Appearance = 0 'Flat
Height = 330
Left = 1800
TabIndex = 1
Top = 360
Width = 2295
End
Begin VB.Label Label3
Caption = "請求終端IP"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 5
Top = 120
Width = 1335
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "終端IP為:"
Height = 255
Left = 360
TabIndex = 2
Top = 1050
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "請求終端SIM號:"
Height = 255
Left = 360
TabIndex = 0
Top = 450
Width = 1335
End
End
Attribute VB_Name = "frm_ip"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
txt_sim.Text = ""
txt_ip.Text = ""
End Sub
Private Sub xpcmdbutton1_Click()
Dim strsql As String
Dim str1 As String
Dim str2 As String
Dim str3 As String
Dim str4 As String
Dim senddata() As Byte
Dim i As Integer
Dim num As Integer
If frm_main.ActiveBar21.Bands("statusbar").Tools("s1").Caption = "現在狀態GSM " Then
MsgBox ("現在狀態GSM,您無法取得終端IP!"), vbOKOnly + vbCritical, "錯誤"
Unload Me
Exit Sub
End If
If Trim(txt_sim.Text) = "" Then
MsgBox ("用戶SIM號不能為空!"), vbOKOnly + vbCritical, "錯誤"
Exit Sub
End If
strsql = "select user_biaohao from userbasic where user_sim='" & Trim(txt_sim.Text) & "'"
openrs strsql
If rs.EOF Then
MsgBox ("不存在該用戶,請仔細查看SIM號!"), vbOKOnly + vbCritical, "錯誤"
Exit Sub
clors
End If
str3 = Trim(txt_sim.Text)
str4 = rs.Fields("user_biaohao").Value
clors
strsql = "select gongdiansuo_pw,gongdiansuo_regcode from gongdiansuoreg "
openrs strsql
str1 = rs.Fields("gongdiansuo_pw").Value
str2 = rs.Fields("gongdiansuo_regcode").Value
clors
ReDim senddata(21) As Byte
For i = 0 To 5 Step 1 '主機密碼
num = Mid(str1, 2 * (i - 0) + 1, 2)
senddata(i) = num
Next i
For i = 6 To 9 Step 1 '主機注冊碼
num = Mid(str2, 2 * (i - 6) + 1, 2)
senddata(i) = num
Next i
For i = 10 To 14 Step 1 'SIM卡號(前5字節)
num = Mid(str3, 2 * (i - 10) + 1, 2)
senddata(i) = num
Next i
num = Mid(str3, 11, 1) 'SIM卡號(后1字節)
senddata(15) = num
For i = 16 To 21 Step 1 '表號
num = Mid(str4, 2 * (i - 16) + 1, 2)
senddata(i) = num
Next i
Dim strregdata1 As String
Dim regdata1() As Byte
Dim regdata2() As Byte
' Dim tempregdata2() As Byte
Dim regdata() As Byte
Dim numregdata As Integer
' Dim i As Integer
Dim centerip As String
Dim centerport As String
centerip = GetInIKeyValue("center", "centerip", App.Path & "\file\gprspcset.ini")
centerport = GetInIKeyValue("center", "centerport", App.Path & "\file\gprspcset.ini")
strregdata1 = "ATJAU" & centerip & "PORT:" & centerport
regdata1 = StrConv(strregdata1, vbFromUnicode)
regdata2 = qrryip_pctocenter(senddata)
numregdata = UBound(regdata1) + UBound(regdata2) + 2
ReDim regdata(numregdata - 1) As Byte
For i = 0 To UBound(regdata1) Step 1
regdata(i) = regdata1(i)
Next i
For i = UBound(regdata1) + 1 To numregdata - 1
regdata(i) = regdata2(i - UBound(regdata1) - 1)
Next i
comsenddata regdata '發送數據
'//清空緩沖區
ReDim bybuff(0) As Byte
bybuff(0) = 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -